v2.3.0: fixed freeze errors when rock throw attacks fail

This commit is contained in:
Evan Debenham
2023-12-15 13:02:07 -05:00
parent 4f4f1b2f35
commit a0bed39019
2 changed files with 8 additions and 3 deletions

View File

@@ -108,8 +108,10 @@ public class GnollGeomancer extends Mob {
}
if (throwingRocksFromPos != null){
boolean attacked = false;
for (int rock : throwingRocksFromPos) {
if (rock != -1 && Dungeon.level.map[rock] == Terrain.MINE_BOULDER) {
attacked = true;
GnollGeomancer.doRockThrowAttack(this, rock, throwingRockToPos);
}
}
@@ -118,7 +120,7 @@ public class GnollGeomancer extends Mob {
throwingRockToPos = -1;
spend(TICK);
return false;
return !attacked;
} else {
return super.act();
}

View File

@@ -123,7 +123,10 @@ public class GnollSapper extends Mob {
@Override
protected boolean act() {
if (throwingRockFromPos != -1){
if (Dungeon.level.map[throwingRockFromPos] == Terrain.MINE_BOULDER) {
boolean attacked = Dungeon.level.map[throwingRockFromPos] == Terrain.MINE_BOULDER;
if (attacked) {
GnollGeomancer.doRockThrowAttack(this, throwingRockFromPos, throwingRockToPos);
}
@@ -131,7 +134,7 @@ public class GnollSapper extends Mob {
throwingRockToPos = -1;
spend(TICK);
return false;
return !attacked;
} else {
return super.act();
}