@@ -23,15 +23,15 @@ extern ConVar p2mm_discord_webhooks;
2323// ---------------------------------------------------------------------------------
2424// Interfaces from the engine
2525// ---------------------------------------------------------------------------------
26- IVEngineServer* engineServer = NULL ; // Access engine server functions (messaging clients, loading content, making entities, running commands, etc).
27- IVEngineClient* engineClient = NULL ; // Access engine client functions.
28- CGlobalVars* g_pGlobals = NULL ; // Access global variables shared between the engine and games dlls.
29- IPlayerInfoManager* g_pPlayerInfoManager = NULL ; // Access interface functions for players.
30- IScriptVM* g_pScriptVM = NULL ; // Access VScript interface.
31- IServerTools* g_pServerTools = NULL ; // Access to interface from engine to tools for manipulating entities.
32- IGameEventManager2* g_pGameEventManager_ = NULL ; // Access game events interface.
33- IServerPluginHelpers* g_pPluginHelpers = NULL ; // Access interface for plugin helper functions.
34- IFileSystem* g_pFileSystem = NULL ; // Access interface for Valve's file system interface.
26+ IVEngineServer* engineServer = nullptr ; // Access engine server functions (messaging clients, loading content, making entities, running commands, etc).
27+ IVEngineClient* engineClient = nullptr ; // Access engine client functions.
28+ CGlobalVars* g_pGlobals = nullptr ; // Access global variables shared between the engine and games dlls.
29+ IPlayerInfoManager* g_pPlayerInfoManager = nullptr ; // Access interface functions for players.
30+ IScriptVM* g_pScriptVM = nullptr ; // Access VScript interface.
31+ IServerTools* g_pServerTools = nullptr ; // Access to interface from engine to tools for manipulating entities.
32+ IGameEventManager2* g_pGameEventManager_ = nullptr ; // Access game events interface.
33+ IServerPluginHelpers* g_pPluginHelpers = nullptr ; // Access interface for plugin helper functions.
34+ IFileSystem* g_pFileSystem = nullptr ; // Access interface for Valve's file system interface.
3535#ifndef GAME_DLL
3636#define g_pGameEventManager g_pGameEventManager_
3737#endif
@@ -524,7 +524,7 @@ void CP2MMServerPlugin::LevelInit(char const* pMapName)
524524#ifdef _WIN32
525525 reinterpret_cast <void (__cdecl*)(bool bDXChange)>(Memory::Scanner::Scan<void *>(ENGINEDLL, " 55 8B EC 83 EC 14 53 33 DB 89" ));
526526#else
527- NULL ; // TODO: Linux & MacOS
527+ nullptr ; // TODO: Linux
528528#endif // _WIN32
529529 if (R_LoadWorldGeometry)
530530 {
@@ -570,15 +570,15 @@ PLUGIN_RESULT CP2MMServerPlugin::ClientCommand(edict_t* pEntity, const CCommand&
570570 P2MMLog (0 , true , " userid: %i" , userid);
571571 P2MMLog (0 , true , " entindex: %i" , entindex);
572572 P2MMLog (0 , true , " playername: %s" , playername);
573- P2MMLog (0 , true , " VScript VM Working?: %s" , (g_pScriptVM != NULL ) ? " Working" : " Not Working!" );
573+ P2MMLog (0 , true , " VScript VM Working?: %s" , (g_pScriptVM) ? " Working" : " Not Working!" );
574574 }
575575
576576 // Call the "GEClientCommand" VScript function
577577 if (g_pScriptVM)
578578 {
579579 HSCRIPT ge_func = g_pScriptVM->LookupFunction (" GEClientCommand" );
580580 if (ge_func)
581- g_pScriptVM->Call <const char *, const char *, int , int , const char *>(ge_func, NULL , false , NULL , pCmd, fArgs , userid, entindex, playername);
581+ g_pScriptVM->Call <const char *, const char *, int , int , const char *>(ge_func, nullptr , false , nullptr , pCmd, fArgs , userid, entindex, playername);
582582 }
583583
584584 // signify is the client command used to make on screen icons appear
@@ -623,7 +623,7 @@ void CP2MMServerPlugin::FireGameEvent(IGameEvent* event)
623623 if (spewinfo)
624624 {
625625 P2MMLog (0 , true , " Game Event Fired: %s" , event->GetName ());
626- P2MMLog (0 , true , " VScript VM Working?: %s" , (g_pScriptVM != NULL ) ? " Working" : " Not Working!" );
626+ P2MMLog (0 , true , " VScript VM Working?: %s" , (g_pScriptVM) ? " Working" : " Not Working!" );
627627 }
628628
629629 // Event called when a player pings, "portal_player_ping" returns:
@@ -646,7 +646,7 @@ void CP2MMServerPlugin::FireGameEvent(IGameEvent* event)
646646 // Handle VScript game event function
647647 HSCRIPT ge_func = g_pScriptVM->LookupFunction (" GEPlayerPing" );
648648 if (ge_func)
649- g_pScriptVM->Call <short , float , float , float , int >(ge_func, NULL , false , NULL , userid, ping_x, ping_y, ping_z, entindex);
649+ g_pScriptVM->Call <short , float , float , float , int >(ge_func, nullptr , false , nullptr , userid, ping_x, ping_y, ping_z, entindex);
650650 }
651651
652652 if (spewinfo)
@@ -676,7 +676,7 @@ void CP2MMServerPlugin::FireGameEvent(IGameEvent* event)
676676 // Handle VScript game event function
677677 HSCRIPT ge_func = g_pScriptVM->LookupFunction (" GEPlayerPortaled" );
678678 if (ge_func)
679- g_pScriptVM->Call <short , bool , int >(ge_func, NULL , false , NULL , userid, portal2, entindex);
679+ g_pScriptVM->Call <short , bool , int >(ge_func, nullptr , false , nullptr , userid, portal2, entindex);
680680 }
681681
682682 if (spewinfo)
@@ -696,7 +696,7 @@ void CP2MMServerPlugin::FireGameEvent(IGameEvent* event)
696696 // Handle VScript game event function
697697 HSCRIPT ge_func = g_pScriptVM->LookupFunction (" GETurretHitTurret" );
698698 if (ge_func)
699- g_pScriptVM->Call (ge_func, NULL , false , NULL );
699+ g_pScriptVM->Call (ge_func, nullptr , false , nullptr );
700700 }
701701
702702 return ;
@@ -709,7 +709,7 @@ void CP2MMServerPlugin::FireGameEvent(IGameEvent* event)
709709 // Handle VScript game event function
710710 HSCRIPT ge_func = g_pScriptVM->LookupFunction (" GECamDetach" );
711711 if (ge_func)
712- g_pScriptVM->Call (ge_func, NULL , false , NULL );
712+ g_pScriptVM->Call (ge_func, nullptr , false , nullptr );
713713 }
714714
715715 return ;
@@ -728,7 +728,7 @@ void CP2MMServerPlugin::FireGameEvent(IGameEvent* event)
728728 // Handle VScript game event function
729729 HSCRIPT ge_func = g_pScriptVM->LookupFunction (" GEPlayerLanded" );
730730 if (ge_func)
731- g_pScriptVM->Call <short , int >(ge_func, NULL , false , NULL , userid, entindex);
731+ g_pScriptVM->Call <short , int >(ge_func, nullptr , false , nullptr , userid, entindex);
732732 }
733733
734734 return ;
@@ -741,7 +741,7 @@ void CP2MMServerPlugin::FireGameEvent(IGameEvent* event)
741741 // Handle VScript game event function
742742 HSCRIPT ge_func = g_pScriptVM->LookupFunction (" GEPlayerSpawnBlue" );
743743 if (ge_func)
744- g_pScriptVM->Call (ge_func, NULL , false , NULL );
744+ g_pScriptVM->Call (ge_func, nullptr , false , nullptr );
745745 }
746746
747747 return ;
@@ -754,7 +754,7 @@ void CP2MMServerPlugin::FireGameEvent(IGameEvent* event)
754754 // Handle VScript game event function
755755 HSCRIPT ge_func = g_pScriptVM->LookupFunction (" GEPlayerSpawnOrange" );
756756 if (ge_func)
757- g_pScriptVM->Call (ge_func, NULL , false , NULL );
757+ g_pScriptVM->Call (ge_func, nullptr , false , nullptr );
758758 }
759759
760760 return ;
@@ -779,15 +779,15 @@ void CP2MMServerPlugin::FireGameEvent(IGameEvent* event)
779779 HSCRIPT playerHandle = INDEXHANDLE (entindex);
780780 if (playerHandle)
781781 {
782- g_pScriptVM->Call <HSCRIPT>(od_func, NULL , false , NULL , playerHandle);
782+ g_pScriptVM->Call <HSCRIPT>(od_func, nullptr , false , nullptr , playerHandle);
783783 g_pDiscordIntegration->SendWebHookEmbed (std::string (GetPlayerName (entindex) + std::string (" Died!" )), " " , EMBEDCOLOR_PLAYERDEATH);
784784 }
785785 }
786786
787787 // Handle VScript game event function
788788 HSCRIPT ge_func = g_pScriptVM->LookupFunction (" GEPlayerDeath" );
789789 if (ge_func)
790- g_pScriptVM->Call <short , short , int >(ge_func, NULL , false , NULL , userid, attacker, entindex);
790+ g_pScriptVM->Call <short , short , int >(ge_func, nullptr , false , nullptr , userid, attacker, entindex);
791791 }
792792
793793 if (spewinfo)
@@ -813,7 +813,7 @@ void CP2MMServerPlugin::FireGameEvent(IGameEvent* event)
813813 // Handle VScript game event function
814814 HSCRIPT ge_func = g_pScriptVM->LookupFunction (" GEPlayerSpawn" );
815815 if (ge_func)
816- g_pScriptVM->Call <short , int >(ge_func, NULL , false , NULL , userid, entindex);
816+ g_pScriptVM->Call <short , int >(ge_func, nullptr , false , nullptr , userid, entindex);
817817 }
818818
819819 if (spewinfo)
@@ -855,7 +855,7 @@ void CP2MMServerPlugin::FireGameEvent(IGameEvent* event)
855855 HSCRIPT ge_func = g_pScriptVM->LookupFunction (" GEPlayerConnect" );
856856 if (ge_func)
857857 {
858- g_pScriptVM->Call <const char *, int , short , const char *, const char *, const char *, bool , int >(ge_func, NULL , false , NULL , name, index, userid, xuid, networkid, address, bot, entindex);
858+ g_pScriptVM->Call <const char *, int , short , const char *, const char *, const char *, bool , int >(ge_func, nullptr , false , nullptr , name, index, userid, xuid, networkid, address, bot, entindex);
859859 g_pDiscordIntegration->SendWebHookEmbed (std::string (name + std::string (" Joined!" )), std::string (name + std::string (" joined the server!" )));
860860 }
861861 }
@@ -898,7 +898,7 @@ void CP2MMServerPlugin::FireGameEvent(IGameEvent* event)
898898 // Handle VScript game event function
899899 HSCRIPT ge_func = g_pScriptVM->LookupFunction (" GEPlayerInfo" );
900900 if (ge_func)
901- g_pScriptVM->Call <const char *, int , short , const char *, const char *, bool , int >(ge_func, NULL , false , NULL , name, index, userid, networkid, address, bot, entindex);
901+ g_pScriptVM->Call <const char *, int , short , const char *, const char *, bool , int >(ge_func, nullptr , false , nullptr , name, index, userid, networkid, address, bot, entindex);
902902 }
903903
904904 if (spewinfo)
@@ -927,13 +927,13 @@ void CP2MMServerPlugin::FireGameEvent(IGameEvent* event)
927927
928928 if (g_pScriptVM)
929929 {
930- if (entindex != NULL )
930+ if (entindex)
931931 {
932932 // Handling chat commands
933933 HSCRIPT cc_func = g_pScriptVM->LookupFunction (" ChatCommands" );
934934 if (cc_func)
935935 {
936- g_pScriptVM->Call <const char *, int >(cc_func, NULL , false , NULL , text, entindex);
936+ g_pScriptVM->Call <const char *, int >(cc_func, nullptr , false , nullptr , text, entindex);
937937
938938 std::string playerName = GetPlayerName (entindex);
939939 std::string chatMsg = text;
@@ -960,7 +960,7 @@ void CP2MMServerPlugin::FireGameEvent(IGameEvent* event)
960960 // Handle VScript game event function
961961 HSCRIPT ge_func = g_pScriptVM->LookupFunction (" GEPlayerSay" );
962962 if (ge_func)
963- g_pScriptVM->Call <short , const char *, int >(ge_func, NULL , false , NULL , userid, text, entindex);
963+ g_pScriptVM->Call <short , const char *, int >(ge_func, nullptr , false , nullptr , userid, text, entindex);
964964 }
965965
966966 if (spewinfo)
@@ -1011,13 +1011,13 @@ void CP2MMServerPlugin::ClientActive(edict_t* pEntity)
10111011 {
10121012 HSCRIPT playerHandle = INDEXHANDLE (entindex);
10131013 if (playerHandle)
1014- g_pScriptVM->Call <HSCRIPT>(opj_func, NULL , false , NULL , playerHandle);
1014+ g_pScriptVM->Call <HSCRIPT>(opj_func, nullptr , false , nullptr , playerHandle);
10151015 }
10161016
10171017 // Handle VScript game event function
10181018 HSCRIPT ge_func = g_pScriptVM->LookupFunction (" GEClientActive" );
10191019 if (ge_func)
1020- g_pScriptVM->Call <short , int >(ge_func, NULL , false , NULL , userid, entindex);
1020+ g_pScriptVM->Call <short , int >(ge_func, nullptr , false , nullptr , userid, entindex);
10211021 }
10221022
10231023 // Update Discord RPC to update player count.
@@ -1032,12 +1032,12 @@ void CP2MMServerPlugin::GameFrame(bool simulating)
10321032{
10331033 HSCRIPT loop_func = g_pScriptVM->LookupFunction (" P2MMLoop" );
10341034 if (loop_func && p2mm_loop.GetBool ())
1035- g_pScriptVM->Call (loop_func, NULL , false , NULL );
1035+ g_pScriptVM->Call (loop_func, nullptr , false , nullptr );
10361036
10371037 // Handle VScript game event function
10381038 HSCRIPT gf_func = g_pScriptVM->LookupFunction (" GEGameFrame" );
10391039 if (gf_func)
1040- g_pScriptVM->Call <bool >(gf_func, NULL , false , NULL , simulating);
1040+ g_pScriptVM->Call <bool >(gf_func, nullptr , false , nullptr , simulating);
10411041}
10421042
10431043extern void updateMapsList ();
0 commit comments