fix shellexecution deleting already inactive unit

This commit is contained in:
Evan
2024-12-10 20:12:21 -08:00
parent d5f6a9c1e4
commit 1a9170d10b
3 changed files with 7 additions and 5 deletions
+4
View File
@@ -20,6 +20,10 @@ export class ShellExecution implements Execution {
if (this.shell == null) {
this.shell = this._owner.buildUnit(UnitType.Shell, 0, this.spawn)
}
if (!this.shell.isActive()) {
this.active = false
return
}
if (!this.target.isActive()) {
this.shell.delete()
this.active = false