@@ -60,9 +60,9 @@ bool COMMAND_Executed(const char* szCommand, const char* szArguments, bool bHand
60
60
g_pClientGame->GetRegisteredCommands ()->ProcessCommand (szCommandBufferPointer, szArguments);
61
61
62
62
// Call the onClientConsole event
63
- auto pLocalPlayer = g_pClientGame->GetLocalPlayer ();
63
+ CClientPlayer* localPlayer = g_pClientGame->GetLocalPlayer ();
64
64
65
- if (pLocalPlayer )
65
+ if (localPlayer != nullptr )
66
66
{
67
67
CLuaArguments Arguments;
68
68
@@ -76,7 +76,7 @@ bool COMMAND_Executed(const char* szCommand, const char* szArguments, bool bHand
76
76
Arguments.PushString (strClumpedCommand);
77
77
}
78
78
79
- pLocalPlayer ->CallEvent (" onClientConsole" , Arguments, true );
79
+ localPlayer ->CallEvent (" onClientConsole" , Arguments, true );
80
80
}
81
81
82
82
// Write the chatlength and the content
@@ -95,12 +95,16 @@ bool COMMAND_Executed(const char* szCommand, const char* szArguments, bool bHand
95
95
}
96
96
else
97
97
{
98
- // Call the onClientCoreCommand event
99
- CLuaArguments Arguments;
100
- Arguments.PushString (szCommand);
98
+ CClientPlayer* localPlayer = g_pClientGame->GetLocalPlayer ();
101
99
102
- auto pLocalPlayer = g_pClientGame->GetLocalPlayer ();
103
- pLocalPlayer->CallEvent (" onClientCoreCommand" , Arguments, true );
100
+ if (localPlayer != nullptr )
101
+ {
102
+ // Call the onClientCoreCommand event
103
+ CLuaArguments Arguments;
104
+ Arguments.PushString (szCommand);
105
+
106
+ localPlayer->CallEvent (" onClientCoreCommand" , Arguments, true );
107
+ }
104
108
105
109
// Call our comand-handlers for core-executed commands too, if allowed
106
110
if (bAllowScriptedBind)
0 commit comments