Skip to content

Commit cdd2a82

Browse files
Pisexroflmuffin
andauthored
Fix crash after map change (#593)
Co-authored-by: Michael Wilson <[email protected]>
1 parent 2b31f51 commit cdd2a82

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/core/globals.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,10 @@ void DetourGameEventManagerInit(IGameEventManager2* pGameEventManager)
141141
}
142142

143143
int source_hook_pluginid = 0;
144-
CGlobalVars* getGlobalVars() { return engineServer2->GetServerGlobals(); }
145-
144+
CGlobalVars* getGlobalVars() {
145+
INetworkGameServer *server = networkServerService->GetIGameServer();
146+
if(!server) return nullptr;
147+
return networkServerService->GetIGameServer()->GetGlobals();
148+
}
146149
} // namespace globals
147150
} // namespace counterstrikesharp

0 commit comments

Comments
 (0)