fix client crash when creating spectator team

This commit is contained in:
Martin Michelsen
2023-09-16 09:57:28 -07:00
parent 4ddc4fce1d
commit 4741091b9f
4 changed files with 72 additions and 59 deletions
+5 -1
View File
@@ -593,8 +593,12 @@ static void server_command_playrec(shared_ptr<ServerState> s, shared_ptr<Lobby>
shared_ptr<Episode3::BattleRecord> record(new Episode3::BattleRecord(data));
shared_ptr<Episode3::BattleRecordPlayer> battle_player(
new Episode3::BattleRecordPlayer(record, s->game_server->get_base()));
create_game_generic(s, c, args.c_str(), u"", Episode::EP3, GameMode::NORMAL,
auto game = create_game_generic(s, c, args.c_str(), u"", Episode::EP3, GameMode::NORMAL,
0, flags, nullptr, battle_player);
if (game) {
s->change_client_lobby(c, game);
c->flags |= Client::Flag::LOADING;
}
}
}