From e06830209c487f2e38130640ea82880068646069 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Br=C3=BCbach?= Date: Thu, 19 Dec 2024 15:28:13 +0100 Subject: [PATCH] Add a default for backwards compatibility. --- common/server_protocolhandler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/server_protocolhandler.cpp b/common/server_protocolhandler.cpp index f8cb67452..7c0968857 100644 --- a/common/server_protocolhandler.cpp +++ b/common/server_protocolhandler.cpp @@ -815,13 +815,14 @@ Server_ProtocolHandler::cmdCreateGame(const Command_CreateGame &cmd, Server_Room } QString description = nameFromStdString(cmd.description()); + int startingLifeTotal = cmd.has_starting_life_total() ? cmd.starting_life_total() : 20; // When server doesn't permit registered users to exist, do not honor only-reg setting bool onlyRegisteredUsers = cmd.only_registered() && (server->permitUnregisteredUsers()); Server_Game *game = new Server_Game( copyUserInfo(false), gameId, description, QString::fromStdString(cmd.password()), cmd.max_players(), gameTypes, cmd.only_buddies(), onlyRegisteredUsers, cmd.spectators_allowed(), cmd.spectators_need_password(), - cmd.spectators_can_talk(), cmd.spectators_see_everything(), cmd.starting_life_total(), room); + cmd.spectators_can_talk(), cmd.spectators_see_everything(), startingLifeTotal, room); game->addPlayer(this, rc, asSpectator, asJudge, false); room->addGame(game);