Fix crash when fresh stk lan game with AI

This commit is contained in:
Benau 2019-10-14 16:34:28 +08:00
parent 48a027e276
commit 76871a3f24

View File

@ -1362,6 +1362,8 @@ int handleCmdLine(bool has_server_config, bool has_parent_process)
NetworkConfig::get()->setIsServer(false);
if (CommandLine::has("--network-ai", &n))
{
// We need an existing current player
PlayerManager::get()->enforceCurrentPlayer();
NetworkConfig::get()->setNetworkAITester(true);
PlayerManager::get()->createGuestPlayers(n);
for (int i = 0; i < n; i++)