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

View File

@ -90,16 +90,20 @@ public class Spinner extends Mob {
@Override
protected boolean act() {
AiState lastState = state;
boolean result = super.act();
webCoolDown--;
if (shotWebVisually){
result = shotWebVisually = false;
} else {
if (enemy != null && enemySeen) {
lastEnemyPos = enemy.pos;
//if state changed from wandering to hunting, we haven't acted yet, don't update.
if (!(lastState == WANDERING && state == HUNTING)) {
webCoolDown--;
if (shotWebVisually){
result = shotWebVisually = false;
} else {
lastEnemyPos = -1;
if (enemy != null && enemySeen) {
lastEnemyPos = enemy.pos;
} else {
lastEnemyPos = Dungeon.hero.pos;
}
}
}