← Back to team overview

widelands-dev team mailing list archive

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

 

Code looks good, just one small question in diff

Diff comments:

> === modified file 'src/logic/militarysite.cc'
> --- src/logic/militarysite.cc	2015-11-21 11:34:10 +0000
> +++ src/logic/militarysite.cc	2015-12-09 20:23:44 +0000
> @@ -204,10 +204,15 @@
>  			 	 	(egbase.map().get_fcoords(get_position()), descr().get_conquers())),
>  			 m_defeating_player);
>  
> -	ProductionSite::cleanup(egbase);
> -
> -	// Note that removing workers during ProductionSite::cleanup can generate
> -	// new requests; that's why we delete it at the end of this function.
> +	Building::cleanup(egbase);
> +
> +	// Evict soldiers to get rid of requests
> +	while (m_capacity > 0) {

I am just curious what is this for, does it fix some problem?

> +		update_soldier_request();
> +		--m_capacity;
> +	}
> +	update_soldier_request();
> +
>  	m_normal_soldier_request.reset();
>  	m_upgrade_soldier_request.reset();
>  }


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


References