diff --git a/src/shattered_sword/AI/EnemyAI.ts b/src/shattered_sword/AI/EnemyAI.ts index f5f9332..d6ebeb0 100644 --- a/src/shattered_sword/AI/EnemyAI.ts +++ b/src/shattered_sword/AI/EnemyAI.ts @@ -134,6 +134,10 @@ export default class EnemyAI extends StateMachineGoapAI implements BattlerAI { activate(options: Record): void { } damage(damage: number): void { + // enemy already dead, do not send new event + if (this.CURRENT_HP <= 0) { + return; + } console.log(damage +" damage taken, "+this.CURRENT_HP+" hp left"); this.CURRENT_HP -= damage; //TODO - @@ -328,4 +332,4 @@ export enum EnemyStates { DEFAULT = "default", ALERT = "alert", PREVIOUS = "previous" -} \ No newline at end of file +}