From dc635415aaca9505bfb18e13b5da62d9d837e087 Mon Sep 17 00:00:00 2001 From: IcePixelx <41352111+PixieCore@users.noreply.github.com> Date: Mon, 23 Aug 2021 22:49:47 +0200 Subject: [PATCH] Fixed crash when starting server. --- r5dev/src/CCompanion.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/r5dev/src/CCompanion.cpp b/r5dev/src/CCompanion.cpp index 409733b8..2898a518 100644 --- a/r5dev/src/CCompanion.cpp +++ b/r5dev/src/CCompanion.cpp @@ -434,8 +434,11 @@ void CCompanion::HostServerSection() * Then when you would normally call launchplaylist which calls StartPlaylist it would cmd call mp_gamemode which parses the gamemode specific part of the playlist.. */ addr_LoadPlaylist(MyServer.playlist.c_str()); - addr_mp_gamemode_Callback(MyServer.playlist.c_str()); - GameGlobals::Cvar->FindVar("mp_gamemode")->m_pzsCurrentValue = MyServer.playlist.c_str(); // Since we call the callback of the cmd, set the playlist name manually here. + std::stringstream cgmd; + cgmd << "mp_gamemode " << MyServer.playlist; + ProcessCommand(cgmd.str().c_str()); + + std::this_thread::sleep_for(std::chrono::milliseconds(100)); // Avoid race condition. std::stringstream cmd; cmd << "map " << ServerMap;