Improve random spawn (#2465)

## Description:

After the v27 playtest, some players experienced instant death on spawn.
The issue was that the human random spawn occasionally coincided with a
bot’s spawn. Previously, bot spawns didn’t account for human spawn
locations and could appear on the same tile, now they don’t.

## Please complete the following:

- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

## Please put your Discord username so you can be contacted if a bug or
regression is found:

nikolaj_mykola

---------

Co-authored-by: Evan <evanpelle@gmail.com>
This commit is contained in:
Mykola
2025-11-18 15:07:25 -08:00
committed by GitHub
co-authored by Evan
parent 90b73451a8
commit 2b2200c808
9 changed files with 71 additions and 19 deletions
+2
View File
@@ -547,6 +547,8 @@ export interface Player {
hasSpawned(): boolean;
setHasSpawned(hasSpawned: boolean): void;
setSpawnTile(spawnTile: TileRef): void;
spawnTile(): TileRef | undefined;
// Territory
tiles(): ReadonlySet<TileRef>;
+9
View File
@@ -102,6 +102,7 @@ export class PlayerImpl implements Player {
public _outgoingLandAttacks: Attack[] = [];
private _hasSpawned = false;
private _spawnTile: TileRef | undefined;
private _isDisconnected = false;
constructor(
@@ -347,6 +348,14 @@ export class PlayerImpl implements Player {
this._hasSpawned = hasSpawned;
}
setSpawnTile(spawnTile: TileRef): void {
this._spawnTile = spawnTile;
}
spawnTile(): TileRef | undefined {
return this._spawnTile;
}
incomingAllianceRequests(): AllianceRequest[] {
return this.mg.allianceRequests.filter((ar) => ar.recipient() === this);
}