Fix capture event fired when undoing

http://gna.org/bugs/?23695
This commit is contained in:
gfgtdf 2015-07-17 17:02:47 +02:00
parent 428421c341
commit db54a8dce5
3 changed files with 5 additions and 5 deletions

View file

@ -138,7 +138,7 @@ void move_unit_spectator::set_unit(const unit_map::const_iterator &u)
}
bool get_village(const map_location& loc, int side, int *action_timebonus)
bool get_village(const map_location& loc, int side, int *action_timebonus, bool fire_event)
{
std::vector<team> &teams = *resources::teams;
team *t = unsigned(side - 1) < teams.size() ? &teams[side - 1] : NULL;
@ -177,7 +177,7 @@ bool get_village(const map_location& loc, int side, int *action_timebonus)
if (resources::screen != NULL) {
resources::screen->invalidate(loc);
}
return t->get_village(loc, old_owner_side, resources::gamedata);
return t->get_village(loc, old_owner_side, fire_event ? resources::gamedata : NULL);
}
return false;

View file

@ -96,7 +96,7 @@ private:
* Makes it so the village at the given location is owned by the given side.
* Returns true if getting the village triggered a mutating event.
*/
bool get_village(const map_location& loc, int side, int *time_bonus = NULL);
bool get_village(const map_location& loc, int side, int *time_bonus = NULL, bool fire_event = true);
/// Moves a unit across the board.
/// And enters the synced context.

View file

@ -64,7 +64,7 @@ bool move_action::undo(int side)
}
if ( resources::gameboard->map().is_village(rev_route.front()) ) {
get_village(rev_route.front(), original_village_owner + 1);
get_village(rev_route.front(), original_village_owner + 1, NULL, false);
//MP_COUNTDOWN take away capture bonus
if ( countdown_time_bonus )
{
@ -125,7 +125,7 @@ bool move_action::redo(int side)
u->anim_comp().set_standing();
if ( resources::gameboard->map().is_village(route.back()) ) {
get_village(route.back(), u->side());
get_village(route.back(), u->side(), NULL, false);
//MP_COUNTDOWN restore capture bonus
if ( countdown_time_bonus )
{