mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-18 09:14:09 +00:00
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:
@@ -547,6 +547,8 @@ export interface Player {
|
||||
|
||||
hasSpawned(): boolean;
|
||||
setHasSpawned(hasSpawned: boolean): void;
|
||||
setSpawnTile(spawnTile: TileRef): void;
|
||||
spawnTile(): TileRef | undefined;
|
||||
|
||||
// Territory
|
||||
tiles(): ReadonlySet<TileRef>;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user