From 530bd7f1bf70f2049e6ab955568fd73f5f120d92 Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Mon, 5 Sep 2022 00:48:32 +0700 Subject: [PATCH] Change launcher to not assume empty game length equals custom game Before simply not filling-in game length setting resulted in it being treated as a custom game length (custom game setting). Not it defaults to a most common used game length - long game with 10 waves. Every other unrecognized value is still being treated as a custom game. --- sources/VotingHandlerAdapter.uc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/sources/VotingHandlerAdapter.uc b/sources/VotingHandlerAdapter.uc index 736e2c5..7a77f67 100644 --- a/sources/VotingHandlerAdapter.uc +++ b/sources/VotingHandlerAdapter.uc @@ -85,7 +85,6 @@ var private config int storedGameLength; var private const array shortSynonyms; var private const array normalSynonyms; var private const array longSynonyms; -var private const array customSynonyms; var private LoggerAPI.Definition fatNoXVotingHandler, fatBadGameConfigIndexVH; var private LoggerAPI.Definition fatBadGameConfigIndexAdapter; @@ -318,6 +317,11 @@ private final function int GetNumericGameLength(BaseGameMode gameMode) local string length; length = Locs(_.text.IntoString(gameMode.GetLength())); + // Custom game is a bad guess for empty game length setting, since it can + // lead to behavior unexpecte by users + if (length == "") { + return 2; + } for (i = 0; i < default.shortSynonyms.length; i += 1) { if (IsPrefixOf(length, default.shortSynonyms[i])) { @@ -336,12 +340,6 @@ private final function int GetNumericGameLength(BaseGameMode gameMode) return 2; } } - for (i = 0; i < default.customSynonyms.length; i += 1) - { - if (IsPrefixOf(length, default.customSynonyms[i])) { - return 3; - } - } return 3; } @@ -357,7 +355,6 @@ defaultproperties normalSynonyms(1) = "medium" normalSynonyms(2) = "regular" longSynonyms(0) = "long" - customSynonyms(0) = "custom" fatNoXVotingHandler = (l=LOG_Fatal,m="`XVotingHandler` class is missing. Make sure your server setup supports Acedia's game modes (by used voting handler derived from `XVotingHandler`).") fatBadGameConfigIndexVH = (l=LOG_Fatal,m="`XVotingHandler`'s `currentGameConfig` variable value of %1 is out-of-bounds for `XVotingHandler.gameConfig` of length %2. Report this issue.") fatBadGameConfigIndexAdapter = (l=LOG_Fatal,m="`XVotingHandler`'s `currentGameConfig` variable value of %1 is out-of-bounds for `VHAdapter` of length %2. Report this issue.")