← Back to team overview

widelands-dev team mailing list archive

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

 

You should get rid of kPureProducer. Looks good to me otherwise. Not tested yet.

Diff comments:

> === modified file 'src/ai/ai_help_structs.h'
> --- src/ai/ai_help_structs.h	2017-09-29 16:10:25 +0000
> +++ src/ai/ai_help_structs.h	2017-11-01 20:33:48 +0000
> @@ -78,6 +78,8 @@
>  	kUpgradeExtends,
>  	kLogRefiner,
>  	kIronMine,
> +	kPureProducer,

kPureProducer is not used anywhere, you can delete it.

> +	kSupportingProducer,
>  };
>  
>  enum class AiType : uint8_t { kVeryWeak, kWeak, kNormal };
> 
> === modified file 'src/ai/defaultai.cc'
> --- src/ai/defaultai.cc	2017-09-29 16:10:25 +0000
> +++ src/ai/defaultai.cc	2017-11-01 20:33:48 +0000
> @@ -698,6 +698,15 @@
>  				bo.positions.push_back(temp_position.first);
>  			}
>  
> +			// If this is a producer, does it act also as supporter?
> +			if (!bo.outputs.empty()) {
> +				if (bo.production_hints.empty()) {
> +					bo.set_is(BuildingAttribute::kPureProducer);
> +				} else {
> +					bo.set_is(BuildingAttribute::kSupportingProducer);
> +				}
> +			}
> +

if (!bo.outputs.empty() && !bo.production_hints.empty()) {
    bo.set_is(BuildingAttribute::kSupportingProducer);
}

Then get rid of the pure producer - you're not using it anywhere.

>  			iron_ore_id = tribe_->ironore();
>  
>  			if (bo.type == BuildingObserver::Type::kMine) {


-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1728006/+merge/333094
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1728006 into lp:widelands.


References