mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-23 10:52:16 -07:00
Add a default for backwards compatibility.
This commit is contained in:
parent
245d6b3e4e
commit
e06830209c
1 changed files with 2 additions and 1 deletions
|
|
@ -815,13 +815,14 @@ Server_ProtocolHandler::cmdCreateGame(const Command_CreateGame &cmd, Server_Room
|
||||||
}
|
}
|
||||||
|
|
||||||
QString description = nameFromStdString(cmd.description());
|
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
|
// When server doesn't permit registered users to exist, do not honor only-reg setting
|
||||||
bool onlyRegisteredUsers = cmd.only_registered() && (server->permitUnregisteredUsers());
|
bool onlyRegisteredUsers = cmd.only_registered() && (server->permitUnregisteredUsers());
|
||||||
Server_Game *game = new Server_Game(
|
Server_Game *game = new Server_Game(
|
||||||
copyUserInfo(false), gameId, description, QString::fromStdString(cmd.password()), cmd.max_players(), gameTypes,
|
copyUserInfo(false), gameId, description, QString::fromStdString(cmd.password()), cmd.max_players(), gameTypes,
|
||||||
cmd.only_buddies(), onlyRegisteredUsers, cmd.spectators_allowed(), cmd.spectators_need_password(),
|
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);
|
game->addPlayer(this, rc, asSpectator, asJudge, false);
|
||||||
room->addGame(game);
|
room->addGame(game);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue