Update TF2_IgnitePlayer to support setting duration of fire (#1038)

Related to #713
This commit is contained in:
42
2019-07-05 22:37:25 +01:00
committed by Asher Baker
parent e47c1a840a
commit 199802150b
2 changed files with 14 additions and 4 deletions
+9 -2
View File
@@ -92,7 +92,7 @@ cell_t TF2_MakeBleed(IPluginContext *pContext, const cell_t *params)
return 1;
}
// native TF2_Burn(client, target)
// native TF2_Burn(client, target, duration)
cell_t TF2_Burn(IPluginContext *pContext, const cell_t *params)
{
static ICallWrapper *pWrapper = NULL;
@@ -126,10 +126,17 @@ cell_t TF2_Burn(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("Client index %d is not valid", params[2]);
}
float fDuration = 10.0;
// Compatibility fix for the newly-added duration
if (params[0] >= 3)
{
fDuration = sp_ctof(params[3]);
}
void *obj = (void *)((uint8_t *)pEntity + playerSharedOffset->actual_offset);
ArgBuffer<void*, CBaseEntity*, CBaseEntity*,
float> //duration
vstk(obj, pTarget, nullptr, 10.0f);
vstk(obj, pTarget, nullptr, fDuration);
pWrapper->Execute(vstk, nullptr);
return 1;