fixed crash in battle events if unit was killed or teleported (bug #10801)

This commit is contained in:
Pauli Nieminen 2008-01-24 21:37:26 +00:00
parent a64489bfe8
commit 62f71ba019
2 changed files with 10 additions and 2 deletions

View file

@ -37,6 +37,7 @@ Version 1.3.14+svn:
* fixed weapon_specials filter_opponent to work in attack selection (bug #8333)
* added a more graceful handling of maps without a header (bug #10787)
* fixed era events not to be added if we are loading save game (bug #10772)
* fixed crash in battle events if unit was killed or teleported (bug #10801)
* make sure the python campaign client list shows a space between the
headers if the size of the column is smaller than the header (eg uploads)

View file

@ -748,8 +748,8 @@ void attack::fire_event(const std::string& n)
tempcfg->values.insert(to_insert);
}
DELAY_END_LEVEL(delayed_exception, game_events::fire(n,
game_events::entity_location(a_),
game_events::entity_location(d_), dat));
attacker_,
defender_, dat));
a_ = units_.find(attacker_);
d_ = units_.find(defender_);
return;
@ -1010,6 +1010,7 @@ attack::attack(game_display& gui, const gamemap& map,
try {
fire_event("attacker_hits");
} catch (attack_end_exception) {
refresh_bc();
break;
}
refresh_bc();
@ -1017,6 +1018,7 @@ attack::attack(game_display& gui, const gamemap& map,
try {
fire_event("attacker_misses");
} catch (attack_end_exception) {
refresh_bc();
break;
}
refresh_bc();
@ -1146,6 +1148,7 @@ attack::attack(game_display& gui, const gamemap& map,
n_defends_ = 0;
n_attacks_ = 0;
DELAY_END_LEVEL(delayed_exception, game_events::fire(stone_string,d_->first,a_->first));
refresh_bc();
}
}
@ -1261,6 +1264,7 @@ attack::attack(game_display& gui, const gamemap& map,
try {
fire_event("defender_hits");
} catch (attack_end_exception) {
refresh_bc();
break;
}
refresh_bc();
@ -1268,6 +1272,7 @@ attack::attack(game_display& gui, const gamemap& map,
try {
fire_event("defender_misses");
} catch (attack_end_exception) {
refresh_bc();
break;
}
refresh_bc();
@ -1368,6 +1373,7 @@ attack::attack(game_display& gui, const gamemap& map,
n_attacks_ = 0;
DELAY_END_LEVEL(delayed_exception, game_events::fire(stone_string,a_->first,d_->first));
refresh_bc();
}
}
@ -1384,6 +1390,7 @@ attack::attack(game_display& gui, const gamemap& map,
}
if(n_attacks_ <= 0 && n_defends_ <= 0) {
fire_event("attack_end");
refresh_bc();
}
}