v1.1.0: fixed an exploit where quitting could cancel enemy attacks

This commit is contained in:
Evan Debenham 2021-09-20 22:57:31 -04:00
parent 050b37b346
commit f8c76e52d9

View File

@ -538,7 +538,6 @@ public abstract class Mob extends Char {
if (sprite != null && (sprite.visible || enemy.sprite.visible)) { if (sprite != null && (sprite.visible || enemy.sprite.visible)) {
sprite.attack( enemy.pos ); sprite.attack( enemy.pos );
spend( attackDelay() );
return false; return false;
} else { } else {
@ -551,6 +550,7 @@ public abstract class Mob extends Char {
@Override @Override
public void onAttackComplete() { public void onAttackComplete() {
attack( enemy ); attack( enemy );
spend( attackDelay() );
super.onAttackComplete(); super.onAttackComplete();
} }