Executions dont switch owner (#326)

when an building is taken over by another player the execution for it
doesnt change its owner this makes it so when a sam is captured it tries
to intercept your own nukes and doesnt intercept the ones by the
previous player

this change makes executions of buildings automaticly switch their owner
This commit is contained in:
Readixyee
2025-03-27 16:03:15 -07:00
committed by GitHub
parent b8e750e31e
commit 665a8c3823
13 changed files with 24 additions and 51 deletions
-2
View File
@@ -156,7 +156,6 @@ export interface Execution {
activeDuringSpawnPhase(): boolean;
init(mg: Game, ticks: number): void;
tick(ticks: number): void;
owner(): Player;
}
export interface Attack {
@@ -375,7 +374,6 @@ export interface Player {
executeRetreat(attackID: string): void;
// Misc
executions(): Execution[];
toUpdate(): PlayerUpdate;
playerProfile(): PlayerProfile;
canBoat(tile: TileRef): boolean;
-5
View File
@@ -285,11 +285,6 @@ export class PlayerImpl implements Player {
isAlive(): boolean {
return this._tiles.size > 0;
}
executions(): Execution[] {
return this.mg
.executions()
.filter((exec) => exec.owner().id() == this.id());
}
incomingAllianceRequests(): AllianceRequest[] {
return this.mg.allianceRequests.filter((ar) => ar.recipient() == this);