don't display unit deleted message when tranpsort ship lands

This commit is contained in:
evanpelle
2024-12-11 16:49:23 -08:00
parent dfe2f27ba8
commit c13bb1eef9
7 changed files with 21 additions and 22 deletions
+2 -2
View File
@@ -57,14 +57,14 @@ export class UnitImpl implements MutableUnit {
)
}
delete(): void {
delete(displayMessage: boolean = true): void {
if (!this.isActive()) {
throw new Error(`cannot delete ${this} not active`)
}
this._owner._units = this._owner._units.filter(b => b != this);
this._active = false;
this.g.fireUnitUpdateEvent(this, this._tile);
if (this.type() != UnitType.AtomBomb && this.type() != UnitType.HydrogenBomb) {
if (displayMessage) {
this.g.displayMessage(`Your ${this.type()} was destroyed`, MessageType.ERROR, this.owner().id())
}
}