Skip to content

Commit

Permalink
Merge pull request #876 from solaris-games/fix/finished-games-issue
Browse files Browse the repository at this point in the history
Fix viewpoint being limited in finished games if the player participa…
  • Loading branch information
SpacialCircumstances authored May 9, 2024
2 parents 92296d5 + 1887b7b commit 0b18ce0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions server/services/gameGalaxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,12 @@ export default class GameGalaxyService {
}

_getViewpoint(game: Game, userId: DBObjectId | null): Viewpoint {
if (this.gameStateService.isFinished(game)) {
return {
kind: ViewpointKind.Finished
};
}

// Check if the user is playing in this game, if so they can only see from
// their own perspective.
let userPlayer = this._getUserPlayer(game, userId);
Expand All @@ -723,11 +729,7 @@ export default class GameGalaxyService {
}
}

if (this.gameStateService.isFinished(game)) {
return {
kind: ViewpointKind.Finished
};
}


return {
kind: ViewpointKind.Basic
Expand Down

0 comments on commit 0b18ce0

Please sign in to comment.