mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-22 02:38:15 +00:00
clientId replay bugfix (was picking first clientID in the array) (#3369)
## Description: clientId replay bugfix (was picking first clientID in the array) https://discord.com/channels/1359946986937258015/1479543573404844042 ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [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: w.o.n
This commit is contained in:
@@ -657,7 +657,7 @@ export class GameView implements GameMap {
|
||||
public worker: WorkerClient,
|
||||
private _config: Config,
|
||||
private _mapData: TerrainMapData,
|
||||
private _myClientID: ClientID,
|
||||
private _myClientID: ClientID | undefined,
|
||||
private _myUsername: string,
|
||||
private _gameID: GameID,
|
||||
private humans: Player[],
|
||||
@@ -785,7 +785,9 @@ export class GameView implements GameMap {
|
||||
}
|
||||
});
|
||||
|
||||
this._myPlayer ??= this.playerByClientID(this._myClientID);
|
||||
if (this._myClientID) {
|
||||
this._myPlayer ??= this.playerByClientID(this._myClientID);
|
||||
}
|
||||
|
||||
for (const unit of this._units.values()) {
|
||||
unit._wasUpdated = false;
|
||||
@@ -1103,7 +1105,7 @@ export class GameView implements GameMap {
|
||||
);
|
||||
}
|
||||
|
||||
myClientID(): ClientID {
|
||||
myClientID(): ClientID | undefined {
|
||||
return this._myClientID;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user