mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Engine: fix out of bound access
Even though this is handles by the class, it really shouldn't happen.
This commit is contained in:
parent
1361bfb172
commit
f6e6e7c30b
@ -250,12 +250,17 @@ Host_Changelevel_f
|
|||||||
*/
|
*/
|
||||||
void Host_Changelevel_f(const CCommand& args)
|
void Host_Changelevel_f(const CCommand& args)
|
||||||
{
|
{
|
||||||
if (args.ArgC() >= 2
|
const int argCount = args.ArgC();
|
||||||
|
|
||||||
|
if (argCount >= 2
|
||||||
&& IsOriginInitialized()
|
&& IsOriginInitialized()
|
||||||
&& g_pServer->IsActive())
|
&& g_pServer->IsActive())
|
||||||
{
|
{
|
||||||
|
const char* levelName = args[1];
|
||||||
|
const char* landMarkName = argCount > 2 ? args[2] : "";
|
||||||
|
|
||||||
v_SetLaunchOptions(args);
|
v_SetLaunchOptions(args);
|
||||||
v_HostState_ChangeLevelMP(args[1], args[2]);
|
v_HostState_ChangeLevelMP(levelName, landMarkName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -399,6 +404,11 @@ Pak_Swap_f
|
|||||||
*/
|
*/
|
||||||
void Pak_Swap_f(const CCommand& args)
|
void Pak_Swap_f(const CCommand& args)
|
||||||
{
|
{
|
||||||
|
if (args.ArgC() < 2)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const char* pakName = nullptr;
|
const char* pakName = nullptr;
|
||||||
|
|
||||||
PakHandle_t pakHandle = INVALID_PAK_HANDLE;
|
PakHandle_t pakHandle = INVALID_PAK_HANDLE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user