alternate view: make trade ships yellow when destined for ally port

This commit is contained in:
evan
2025-04-24 08:09:28 -07:00
parent 35805b2e4e
commit e86e4d581c
+7 -2
View File
@@ -428,8 +428,13 @@ export class UnitLayer implements Layer {
let rel = this.relationship(unit);
if (unit.type() == UnitType.TradeShip && unit.dstPortId() != null) {
const target = this.game.unit(unit.dstPortId())?.owner();
if (this.game.myPlayer() != null && this.game.myPlayer() == target) {
rel = Relationship.Self;
const myPlayer = this.game.myPlayer();
if (myPlayer != null) {
if (myPlayer == target) {
rel = Relationship.Self;
} else if (myPlayer.isFriendly(target)) {
rel = Relationship.Ally;
}
}
}
switch (rel) {