widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #04816
Re: [Merge] lp:~widelands-dev/widelands/militarysites into lp:widelands
Added a comment to your comment :)
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) {
Yes - this is to make sure that there are no dead requests left over after the building is gone. The destructor has an assert for this, and if I don't get rid of the soldiers, it will trigger a crash. The productionsite has similar code.
> + 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