fix: game node undefined

This commit is contained in:
qndydyhm 2022-04-23 00:56:49 +08:00 committed by GitHub
parent d4e69bb3ff
commit 2bf59346f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -134,6 +134,10 @@ export default class EnemyAI extends StateMachineGoapAI implements BattlerAI {
activate(options: Record<string, any>): 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 -