v0.8.0: fixed spinners not aiming their web correctly in some cases

This commit is contained in:
Evan Debenham
2020-03-15 21:30:16 -04:00
parent f8cdce2a53
commit 436f5ea18d
@@ -90,16 +90,20 @@ public class Spinner extends Mob {
@Override @Override
protected boolean act() { protected boolean act() {
AiState lastState = state;
boolean result = super.act(); boolean result = super.act();
webCoolDown--; //if state changed from wandering to hunting, we haven't acted yet, don't update.
if (shotWebVisually){ if (!(lastState == WANDERING && state == HUNTING)) {
result = shotWebVisually = false; webCoolDown--;
} else { if (shotWebVisually){
if (enemy != null && enemySeen) { result = shotWebVisually = false;
lastEnemyPos = enemy.pos;
} else { } else {
lastEnemyPos = -1; if (enemy != null && enemySeen) {
lastEnemyPos = enemy.pos;
} else {
lastEnemyPos = Dungeon.hero.pos;
}
} }
} }