From 9af75331e287a16588902e563c05bd5af242e4af Mon Sep 17 00:00:00 2001 From: Evan Date: Mon, 25 Nov 2024 14:10:17 -0800 Subject: [PATCH] update alliance() --- src/core/execution/NukeExecution.ts | 4 +--- src/core/game/PlayerImpl.ts | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/execution/NukeExecution.ts b/src/core/execution/NukeExecution.ts index 111484c75..9a729991a 100644 --- a/src/core/execution/NukeExecution.ts +++ b/src/core/execution/NukeExecution.ts @@ -80,9 +80,7 @@ export class NukeExecution implements Execution { const mp = this.mg.player(owner.id()) mp.relinquish(tile) mp.removeTroops(ratio[mp.id()]) - if (owner != this.player) { - others.add(mp) - } + others.add(mp) } } for (const other of others) { diff --git a/src/core/game/PlayerImpl.ts b/src/core/game/PlayerImpl.ts index f453d922e..9335be702 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -152,6 +152,9 @@ export class PlayerImpl implements MutablePlayer { } allianceWith(other: Player): MutableAlliance | null { + if (other == this) { + return null + } return this.alliances().find(a => a.recipient() == other || a.requestor() == other) }