Bugfix - Prevent force-close when a monster dies from a lingering actor condition (issue 336). Thanks to Xero from the forums for finding the bug!

This commit is contained in:
Oskar Wiksten
2013-01-28 00:39:49 +01:00
parent 745d0fec6a
commit 6d2b97d8d2

View File

@@ -248,9 +248,11 @@ public class ActorStatsController {
public void applyConditionsToMonsters(PredefinedMap map, boolean isFullRound) {
for (MonsterSpawnArea a : map.spawnAreas) {
for (Monster m : a.monsters) {
applyConditionsToMonster(m, isFullRound);
}
// Iterate the array backwards, since monsters may get removed from the array inside applyConditionsToMonster.
for (int i = a.monsters.size()-1; i >= 0; --i) {
final Monster m = a.monsters.get(i);
applyConditionsToMonster(m, isFullRound);
}
}
}