Skip to content

Commit

Permalink
catch exceptions thrown in unit_movement_resetter dtor
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeck88 committed Jun 8, 2014
1 parent 0e24beb commit bdd3edd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/unit.cpp
Expand Up @@ -2944,6 +2944,7 @@ unit_movement_resetter::unit_movement_resetter(unit &u, bool operate) :
unit_movement_resetter::~unit_movement_resetter()
{
assert(resources::units);
try {

if(!resources::units->has_unit(&u_)) {
/*
Expand All @@ -2953,6 +2954,8 @@ unit_movement_resetter::~unit_movement_resetter()
DBG_UT << "The unit to be removed is not in the unit map.\n";
}
u_.set_movement(moves_);

} catch (...) {}
}

bool unit::matches_id(const std::string& unit_id) const
Expand Down

0 comments on commit bdd3edd

Please sign in to comment.