mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-27 13:14:13 -08:00
Support starting games with fewer than max players (#5338)
This commit is contained in:
@@ -944,7 +944,7 @@ Server_Player::cmdReadyStart(const Command_ReadyStart &cmd, ResponseContainer &
|
||||
return Response::RespContextError;
|
||||
}
|
||||
|
||||
if (readyStart == cmd.ready()) {
|
||||
if (readyStart == cmd.ready() && !cmd.force_start()) {
|
||||
return Response::RespContextError;
|
||||
}
|
||||
|
||||
@@ -955,8 +955,13 @@ Server_Player::cmdReadyStart(const Command_ReadyStart &cmd, ResponseContainer &
|
||||
ges.enqueueGameEvent(event, playerId);
|
||||
ges.setGameEventContext(Context_ReadyStart());
|
||||
|
||||
if (cmd.ready()) {
|
||||
game->startGameIfReady();
|
||||
if (cmd.force_start()) {
|
||||
if (game->getHostId() != playerId) {
|
||||
return Response::RespFunctionNotAllowed;
|
||||
}
|
||||
game->startGameIfReady(true);
|
||||
} else if (cmd.ready()) {
|
||||
game->startGameIfReady(false);
|
||||
}
|
||||
|
||||
return Response::RespOk;
|
||||
|
||||
Reference in New Issue
Block a user