diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-03-15 00:04:33 +0000 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2022-03-15 00:04:33 +0000 |
commit | 96aa95aede1fb1f3fde3d2c08728c37520bea4c2 (patch) | |
tree | 6ef9b43cab5e215a05fabf0bd197dc3a0593c525 /NorthstarDedicatedTest/plugins.cpp | |
parent | 5df2346ba1414fd43d80fc2919c2f880b7f8aeaf (diff) | |
download | NorthstarLauncher-96aa95aede1fb1f3fde3d2c08728c37520bea4c2.tar.gz NorthstarLauncher-96aa95aede1fb1f3fde3d2c08728c37520bea4c2.zip |
move to using g_pCVar more
Diffstat (limited to 'NorthstarDedicatedTest/plugins.cpp')
-rw-r--r-- | NorthstarDedicatedTest/plugins.cpp | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/NorthstarDedicatedTest/plugins.cpp b/NorthstarDedicatedTest/plugins.cpp index 383555cf..b725a5a8 100644 --- a/NorthstarDedicatedTest/plugins.cpp +++ b/NorthstarDedicatedTest/plugins.cpp @@ -390,21 +390,25 @@ void InitialisePluginCommands(HMODULE baseAddress) // i swear there's a way to make this not have be run in 2 contexts but i can't figure it out // some funcs i need are just not available in UI or CLIENT - g_UISquirrelManager->AddFuncRegistration( - "void", "NSUpdateGameStateUI", "string gamemode, string gamemodeName, string map, string mapName, bool connected, bool loading", "", - SQ_UpdateGameStateUI); - g_ClientSquirrelManager->AddFuncRegistration( - "void", "NSUpdateGameStateClient", - "int playerCount, int outScore, int secondHighestScore, int highestScore, bool roundBased, int scoreLimit", "", - SQ_UpdateGameStateClient); - g_UISquirrelManager->AddFuncRegistration( - "void", "NSUpdateServerInfo", - "string id, string name, string password, int players, int maxPlayers, string map, string mapDisplayName, string playlist, string " - "playlistDisplayName", - "", SQ_UpdateServerInfo); - g_ClientSquirrelManager->AddFuncRegistration( - "void", "NSUpdateServerInfoReload", "int maxPlayers", "", SQ_UpdateServerInfoBetweenRounds); - g_ClientSquirrelManager->AddFuncRegistration("void", "NSUpdateTimeInfo", "float timeInFuture", "", SQ_UpdateTimeInfo); - g_UISquirrelManager->AddFuncRegistration("void", "NSSetLoading", "bool loading", "", SQ_SetConnected); - g_UISquirrelManager->AddFuncRegistration("void", "NSUpdateListenServer", "", "", SQ_UpdateListenServer); + if (g_UISquirrelManager && g_ClientSquirrelManager) + { + g_UISquirrelManager->AddFuncRegistration( + "void", "NSUpdateGameStateUI", "string gamemode, string gamemodeName, string map, string mapName, bool connected, bool loading", + "", SQ_UpdateGameStateUI); + g_ClientSquirrelManager->AddFuncRegistration( + "void", "NSUpdateGameStateClient", + "int playerCount, int outScore, int secondHighestScore, int highestScore, bool roundBased, int scoreLimit", "", + SQ_UpdateGameStateClient); + g_UISquirrelManager->AddFuncRegistration( + "void", "NSUpdateServerInfo", + "string id, string name, string password, int players, int maxPlayers, string map, string mapDisplayName, string playlist, " + "string " + "playlistDisplayName", + "", SQ_UpdateServerInfo); + g_ClientSquirrelManager->AddFuncRegistration( + "void", "NSUpdateServerInfoReload", "int maxPlayers", "", SQ_UpdateServerInfoBetweenRounds); + g_ClientSquirrelManager->AddFuncRegistration("void", "NSUpdateTimeInfo", "float timeInFuture", "", SQ_UpdateTimeInfo); + g_UISquirrelManager->AddFuncRegistration("void", "NSSetLoading", "bool loading", "", SQ_SetConnected); + g_UISquirrelManager->AddFuncRegistration("void", "NSUpdateListenServer", "", "", SQ_UpdateListenServer); + } } |