Fixed potential crash with _NET_SetKey_f_CompletionFunc.

This commit is contained in:
IcePixelx 2021-12-26 02:37:56 +01:00
parent c81aca28de
commit 0ca5b5ae35

View File

@ -576,9 +576,6 @@ void _VPK_Decompress_f_CompletionFunc(CCommand* cmd)
void _NET_SetKey_f_CompletionFunc(CCommand* cmd)
{
CCommand& args = *cmd; // Get reference.
std::string firstArg = args[1]; // Get first arg.
std::int32_t argSize = *(std::int32_t*)((std::uintptr_t)cmd + 0x4);
if (argSize < 2) // Do we atleast have 2 arguments?
@ -586,6 +583,9 @@ void _NET_SetKey_f_CompletionFunc(CCommand* cmd)
return;
}
CCommand& args = *cmd; // Get reference.
std::string firstArg = args[1]; // Get first arg.
HNET_SetKey(firstArg);
}