diff options
Diffstat (limited to 'backend/Dungeon.cpp')
-rw-r--r-- | backend/Dungeon.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/backend/Dungeon.cpp b/backend/Dungeon.cpp index ad721b4..84f9c79 100644 --- a/backend/Dungeon.cpp +++ b/backend/Dungeon.cpp @@ -20,6 +20,7 @@ void Dungeon::update_attacks(ListRange<Enemy *> & enemies) { lprtf(":: De vijand%s in je locatie vallen aan! ::\n", enemies.size() == 1 ? "" : "en"); RNG & rng = RNG::get(); for (Enemy * enemy : enemies) { + if (enemy->is_dead()) continue; if (rng.rand_double() < enemy->get_attack()) continue; unsigned damage = rng.rand_int(enemy->get_damage_min(), enemy->get_damage_max() + 1); @@ -32,6 +33,7 @@ void Dungeon::update_movement() { bool moved = false; for (Location * location : this->locations) { for (Enemy * enemy : location->get_enemies()) { + if (enemy->is_dead()) continue; if (RNG::get().rand_double() < 0.5) continue; if (!moved) |