mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 11:20:45 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user