SDKTools: Add explode parameter to ForcePlayerSuicide native (#1782)
* Expose CommitSuicide params * A single space * Validate param count * Set force param to true by default
This commit is contained in:
@@ -516,19 +516,23 @@ static cell_t ForcePlayerSuicide(IPluginContext *pContext, const cell_t *params)
|
||||
return pContext->ThrowNativeError("\"CommitSuicide\" wrapper failed to initialize");
|
||||
}
|
||||
}
|
||||
bool bForce = false;
|
||||
if (!strcmp(g_pSM->GetGameFolderName(), "zps"))
|
||||
{
|
||||
// ZPS requires force to be set as true otherwise the action itself is delayed.
|
||||
// Which affects Slay and Timebomb.
|
||||
bForce = true;
|
||||
}
|
||||
|
||||
START_CALL();
|
||||
DECODE_VALVE_PARAM(1, thisinfo, 0);
|
||||
*(bool *)(vptr + pCall->vparams[0].offset) = false;
|
||||
*(bool *)(vptr + pCall->vparams[1].offset) = bForce;
|
||||
|
||||
if (params[0] >= 2)
|
||||
{
|
||||
DECODE_VALVE_PARAM(2, vparams, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
*(bool *)(vptr + pCall->vparams[0].offset) = false;
|
||||
}
|
||||
|
||||
*(bool *)(vptr + pCall->vparams[1].offset) = true;
|
||||
|
||||
FINISH_CALL_SIMPLE(NULL);
|
||||
|
||||
return 1;
|
||||
}
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user