Additional checks to see if unit still exists,

...before trying to reset its appearance.  Tentative fix for bug
#19135
This commit is contained in:
Gabriel Morin 2011-12-10 22:54:26 +00:00
parent b69d94ad6c
commit 03f0abb017

View file

@ -306,7 +306,12 @@ void manager::pre_delete_action(action_ptr action)
&& boost::dynamic_pointer_cast<move>(action)
&& viewer_actions()->count_actions_of(action->get_unit()) == 1)
{
action->get_unit()->set_standing(true);
//but first, check that the unit's still around and that it's the same one
unit_map::iterator unit_it =
resources::units->find(boost::static_pointer_cast<move>(action)->get_dest_hex());
if (unit_it != resources::units->end() && &*unit_it == action->get_unit()) {
action->get_unit()->set_standing(true);
}
}
}