Skip to content

Commit

Permalink
Fix crash after map change (#593)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
  • Loading branch information
Pisex and roflmuffin authored Oct 4, 2024
1 parent 2b31f51 commit cdd2a82
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ void DetourGameEventManagerInit(IGameEventManager2* pGameEventManager)
}

int source_hook_pluginid = 0;
CGlobalVars* getGlobalVars() { return engineServer2->GetServerGlobals(); }

CGlobalVars* getGlobalVars() {
INetworkGameServer *server = networkServerService->GetIGameServer();
if(!server) return nullptr;
return networkServerService->GetIGameServer()->GetGlobals();
}
} // namespace globals
} // namespace counterstrikesharp

0 comments on commit cdd2a82

Please sign in to comment.