Fix logging replay crashes.

Fixes bug #15601, applies patch #1525.
This commit is contained in:
Mark de Wever 2010-03-18 20:16:07 +00:00
parent c546e8f5dc
commit 76815744fe
2 changed files with 7 additions and 5 deletions

View File

@ -6,6 +6,7 @@ Version 1.7.15+svn:
* Miscellaneous and bug fixes:
* Defaulted log level to error again
* Fix bug #14114: checksum operations fail against certain scenario events
* Fix bug #15601: replay crashes when replay log messages are enabled
Version 1.7.15-1.8rc1:
* AI:

View File

@ -1134,17 +1134,18 @@ bool do_replay_handle(int side_num, const std::string &do_untill)
rand_rng::set_seed(seed);
LOG_REPLAY << "Replaying attack with seed " << seed << "\n";
DBG_REPLAY << "Attacker XP (before attack): " << u->second.experience() << "\n";;
DBG_REPLAY << "Attacker XP (before attack): " << u->second.experience() << "\n";
attack_unit(src, dst, weapon_num, def_weapon_num, !get_replay_source().is_skipping());
DBG_REPLAY << "Attacker XP (after attack): " << u->second.experience() << "\n";;
u = resources::units->find(src);
tgt = resources::units->find(dst);
if (u.valid() && u->second.advances()) {
get_replay_source().add_expected_advancement(u->first);
if(u.valid()){
DBG_REPLAY << "Attacker XP (after attack): " << u->second.experience() << "\n";
if(u->second.advances()) {
get_replay_source().add_expected_advancement(u->first);
}
}
DBG_REPLAY << "expected_advancements.size: " << get_replay_source().expected_advancements().size() << "\n";