Skip to content

Commit

Permalink
bug #23188: check the game events for NULL when capturing villages
Browse files Browse the repository at this point in the history
This is a minor change in that village capture events won't be
fired during team building, whereas in 1.12 it appears that they
would be.
  • Loading branch information
cbeck88 committed Mar 1, 2015
1 parent 9e8645a commit e89f52c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/team.cpp
Expand Up @@ -365,7 +365,12 @@ bool team::get_village(const map_location& loc, const int owner_side, game_data
config::attribute_value& var = gamedata->get_variable("owner_side");
const config::attribute_value old_value = var;
var = owner_side;
gamestate_changed = resources::game_events->pump().fire("capture",loc);

// During team building, game_events pump is not guaranteed to exist yet. (At current revision.) We skip capture events in this case.
if (resources::game_events) {
gamestate_changed = resources::game_events->pump().fire("capture",loc);
}

if(old_value.blank())
gamedata->clear_variable("owner_side");
else
Expand Down

0 comments on commit e89f52c

Please sign in to comment.