Only notify on warship and transport ship destruction

displayMessageOnDeleted fired a "Your {unit} was destroyed" message for
nearly every unit type (denylisting only MIRV warheads and train cars),
which spammed the event feed with low-stakes losses like ports, cities,
and trade ships.

Flip it to an allowlist: only surface destruction of warships and
transport ships, the two losses with real tactical weight (lost naval
control, lost army at sea). Everything else is either visible on the map
or not worth a notification.
This commit is contained in:
evanpelle
2026-06-10 16:00:29 -07:00
parent 9396df1ca4
commit 5cb155267d
+6 -5
View File
@@ -308,11 +308,12 @@ export class UnitImpl implements Unit {
}
private displayMessageOnDeleted(): void {
if (this._type === UnitType.MIRVWarhead) {
return;
}
if (this._type === UnitType.Train && this._trainType !== TrainType.Engine) {
// Only warships and transport ships are worth notifying about; everything
// else is either visible on the map or too low-stakes to surface.
if (
this._type !== UnitType.Warship &&
this._type !== UnitType.TransportShip
) {
return;
}