v2.3.0: fixed freeze errors when rock throw attacks fail
This commit is contained in:
+3
-1
@@ -108,8 +108,10 @@ public class GnollGeomancer extends Mob {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (throwingRocksFromPos != null){
|
if (throwingRocksFromPos != null){
|
||||||
|
boolean attacked = false;
|
||||||
for (int rock : throwingRocksFromPos) {
|
for (int rock : throwingRocksFromPos) {
|
||||||
if (rock != -1 && Dungeon.level.map[rock] == Terrain.MINE_BOULDER) {
|
if (rock != -1 && Dungeon.level.map[rock] == Terrain.MINE_BOULDER) {
|
||||||
|
attacked = true;
|
||||||
GnollGeomancer.doRockThrowAttack(this, rock, throwingRockToPos);
|
GnollGeomancer.doRockThrowAttack(this, rock, throwingRockToPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -118,7 +120,7 @@ public class GnollGeomancer extends Mob {
|
|||||||
throwingRockToPos = -1;
|
throwingRockToPos = -1;
|
||||||
|
|
||||||
spend(TICK);
|
spend(TICK);
|
||||||
return false;
|
return !attacked;
|
||||||
} else {
|
} else {
|
||||||
return super.act();
|
return super.act();
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-2
@@ -123,7 +123,10 @@ public class GnollSapper extends Mob {
|
|||||||
@Override
|
@Override
|
||||||
protected boolean act() {
|
protected boolean act() {
|
||||||
if (throwingRockFromPos != -1){
|
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);
|
GnollGeomancer.doRockThrowAttack(this, throwingRockFromPos, throwingRockToPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,7 +134,7 @@ public class GnollSapper extends Mob {
|
|||||||
throwingRockToPos = -1;
|
throwingRockToPos = -1;
|
||||||
|
|
||||||
spend(TICK);
|
spend(TICK);
|
||||||
return false;
|
return !attacked;
|
||||||
} else {
|
} else {
|
||||||
return super.act();
|
return super.act();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user