v2.3.0: fixed freeze errors when rock throw attacks fail
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user