Turn around true/false for better readability

This commit is contained in:
VariableVince
2026-04-03 03:41:04 +02:00
parent 511debc10c
commit 57de2418aa
2 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -151,7 +151,7 @@ export class MapPlaylist {
public async gameConfigNotInUse(
type: PublicGameType,
isInUse: (config: GameConfig) => boolean,
notInUse: (config: GameConfig) => boolean,
): Promise<GameConfig> {
const maxAttempts = 6;
let attempts = 0;
@@ -161,7 +161,7 @@ export class MapPlaylist {
const config = await this.buildConfig(type, map);
attempts++;
if (!isInUse(config) || attempts >= maxAttempts) {
if (notInUse(config) || attempts >= maxAttempts) {
this.consumeNextMap(type);
return config;
}
+4 -4
View File
@@ -177,20 +177,20 @@ export class MasterLobbyService {
}
const gameConfig = await this.playlist.gameConfigNotInUse(type, (c) => {
if (usedMaps.has(c.gameMap)) return true;
if (usedMaps.has(c.gameMap)) return false;
if (
c.playerTeams !== undefined &&
usedTeamTypes.has(String(c.playerTeams))
) {
return true;
return false;
}
if (c.maxPlayers !== undefined && usedMaxPlayers.has(c.maxPlayers)) {
return true;
return false;
}
return false;
return true;
});
recordInUse(gameConfig);