process advancement in [unstore_unit] only if it's our side's turn

this prevents all clients from doing the advancement simultaneously
and potentially causing OOS and thus allows the safe use of
[unstore_unit] in turn events
This commit is contained in:
Gunter Labes 2009-10-21 21:46:11 +00:00
parent f5c405aa3e
commit 1554c2a2ec

View file

@ -2558,7 +2558,8 @@ WML_HANDLER_FUNCTION(unstore_unit, /*event_info*/, cfg)
}
const int side = controller->current_side();
if(utils::string_bool(cfg["advance"], true) && get_replay_source().at_end()) {
if (utils::string_bool(cfg["advance"], true) && get_replay_source().at_end()
&& (*resources::teams)[side-1].is_local()) {
// Try to advance the unit
// Select advancement if it is on the playing side and the player is a human
const bool sel = (side == static_cast<int>(u.side())