Skip to content

Commit

Permalink
unify crash/destruction checks for UFOs
Browse files Browse the repository at this point in the history
  • Loading branch information
Warboy1982 committed Jun 13, 2020
1 parent e5e9321 commit a4f0404
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Savegame/Ufo.cpp
Expand Up @@ -124,11 +124,11 @@ void Ufo::load(const YAML::Node &node, const Mod &mod, SavedGame &game)
}
else
{
if (_damage >= _rules->getMaxDamage())
if (isDestroyed())
{
_status = DESTROYED;
}
else if (_damage >= _rules->getMaxDamage() / 2)
else if (isCrashed())
{
_status = CRASHED;
}
Expand Down Expand Up @@ -327,11 +327,11 @@ void Ufo::setDamage(int damage)
{
_damage = 0;
}
if (_damage >= _rules->getMaxDamage())
if (isDestroyed())
{
_status = DESTROYED;
}
else if (_damage >= _rules->getMaxDamage() / 2)
else if (isCrashed())
{
_status = CRASHED;
}
Expand Down

0 comments on commit a4f0404

Please sign in to comment.