← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/bug-1818073-worker into lp:widelands

 

Review: Needs Fixing

The fix in r9003 is wrong (see my in-line comment)

Diff comments:

> === modified file 'src/logic/map_objects/tribes/worker.cc'
> --- src/logic/map_objects/tribes/worker.cc	2019-02-27 17:19:00 +0000
> +++ src/logic/map_objects/tribes/worker.cc	2019-03-01 16:32:50 +0000
> @@ -138,15 +138,17 @@
>  		totalchance += 8 * amount;
>  
>  		// Add penalty for fields that are running out
> -		if (amount == 0)
> -			// we already know it's completely empty, so punish is less
> -			totalchance += 1;
> -		else if (amount <= 2)
> +		// Except for totally depleted fields or wrong ressource fields
> +		// if we already know there is no ressource (left) we won't mine there
> +		if (amount == 0) {
> +			totalchance += 0;

This line does not do anything whatsoever. x + 0 = x.

> +		} else if (amount <= 2) {
>  			totalchance += 6;
> -		else if (amount <= 4)
> +		} else if (amount <= 4) {
>  			totalchance += 4;
> -		else if (amount <= 6)
> +		} else if (amount <= 6) {
>  			totalchance += 2;
> +		}
>  	} while (mr.advance(*map));
>  
>  	if (totalres == 0) {


-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1818073-worker/+merge/363851
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1818073-worker.


References