Fix for crashes related to the GameRules_Set* natives.
This commit is contained in:
parent
148943dad6
commit
7fbc9869bd
@ -264,7 +264,6 @@ static cell_t GameRules_SetProp(IPluginContext *pContext, const cell_t *params)
|
||||
*(int32_t *)((intptr_t)pGameRules + offset) = params[2];
|
||||
if (sendChange)
|
||||
{
|
||||
*(int32_t *)((intptr_t)pProxy + offset) = params[2];
|
||||
gamehelpers->SetEdictStateChanged(gamehelpers->EdictOfIndex(gamehelpers->EntityToBCompatRef(pProxy)), offset);
|
||||
}
|
||||
}
|
||||
@ -273,7 +272,6 @@ static cell_t GameRules_SetProp(IPluginContext *pContext, const cell_t *params)
|
||||
*(int16_t *)((intptr_t)pGameRules + offset) = (int16_t)params[2];
|
||||
if (sendChange)
|
||||
{
|
||||
*(int16_t *)((intptr_t)pProxy + offset) = (int16_t)params[2];
|
||||
gamehelpers->SetEdictStateChanged(gamehelpers->EdictOfIndex(gamehelpers->EntityToBCompatRef(pProxy)), offset);
|
||||
}
|
||||
}
|
||||
@ -282,7 +280,6 @@ static cell_t GameRules_SetProp(IPluginContext *pContext, const cell_t *params)
|
||||
*(int8_t *)((intptr_t)pGameRules + offset) = (int8_t)params[2];
|
||||
if (sendChange)
|
||||
{
|
||||
*(int8_t *)((intptr_t)pProxy + offset) = (int8_t)params[2];
|
||||
gamehelpers->SetEdictStateChanged(gamehelpers->EdictOfIndex(gamehelpers->EntityToBCompatRef(pProxy)), offset);
|
||||
}
|
||||
}
|
||||
@ -291,7 +288,6 @@ static cell_t GameRules_SetProp(IPluginContext *pContext, const cell_t *params)
|
||||
*(bool *)((intptr_t)pGameRules + offset) = (params[2] == 0) ? false : true;
|
||||
if (sendChange)
|
||||
{
|
||||
*(bool *)((intptr_t)pProxy + offset) = (params[2] == 0) ? false : true;
|
||||
gamehelpers->SetEdictStateChanged(gamehelpers->EdictOfIndex(gamehelpers->EntityToBCompatRef(pProxy)), offset);
|
||||
}
|
||||
}
|
||||
@ -350,7 +346,6 @@ static cell_t GameRules_SetPropFloat(IPluginContext *pContext, const cell_t *par
|
||||
|
||||
if (sendChange)
|
||||
{
|
||||
*(float *)((intptr_t)pProxy + offset) = newVal;
|
||||
gamehelpers->SetEdictStateChanged(gamehelpers->EdictOfIndex(gamehelpers->EntityToBCompatRef(pProxy)), offset);
|
||||
}
|
||||
|
||||
@ -430,17 +425,6 @@ static cell_t GameRules_SetPropEnt(IPluginContext *pContext, const cell_t *param
|
||||
|
||||
if (sendChange)
|
||||
{
|
||||
CBaseHandle &hndl = *(CBaseHandle *)((intptr_t)pProxy + offset);
|
||||
if (params[2] == -1)
|
||||
{
|
||||
hndl.Set(NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
IHandleEntity *pHandleEnt = (IHandleEntity *)pOther;
|
||||
hndl.Set(pHandleEnt);
|
||||
}
|
||||
|
||||
gamehelpers->SetEdictStateChanged(gamehelpers->EdictOfIndex(gamehelpers->EntityToBCompatRef(pProxy)), offset);
|
||||
}
|
||||
|
||||
@ -510,11 +494,6 @@ static cell_t GameRules_SetPropVector(IPluginContext *pContext, const cell_t *pa
|
||||
|
||||
if (sendChange)
|
||||
{
|
||||
v = (Vector *)((intptr_t)pProxy + offset);
|
||||
v->x = sp_ctof(vec[0]);
|
||||
v->y = sp_ctof(vec[1]);
|
||||
v->z = sp_ctof(vec[2]);
|
||||
|
||||
gamehelpers->SetEdictStateChanged(gamehelpers->EdictOfIndex(gamehelpers->EntityToBCompatRef(pProxy)), offset);
|
||||
}
|
||||
|
||||
@ -625,8 +604,6 @@ static cell_t GameRules_SetPropString(IPluginContext *pContext, const cell_t *pa
|
||||
|
||||
if (sendChange)
|
||||
{
|
||||
dest = (char *)((intptr_t)pProxy + offset);
|
||||
strncopy(dest, src, maxlen);
|
||||
gamehelpers->SetEdictStateChanged(gamehelpers->EdictOfIndex(gamehelpers->EntityToBCompatRef(pProxy)), offset);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user