CPointScriptUseTarget::Use
0x00902ac0 · 748 bytes · __cdecl
_ZN21CPointScriptUseTarget3UseEP11CBaseEntityS1_8USE_TYPEf
Decompiled
undefined (4 params)
/* CPointScriptUseTarget::Use(CBaseEntity*, CBaseEntity*, USE_TYPE, float) */
void CPointScriptUseTarget::Use(CBaseEntity *param_1,CTerrorPlayer *param_2)
{
uint uVar1;
int *piVar2;
char cVar3;
CBaseEntity CVar4;
undefined *puVar5;
undefined4 *puVar6;
CTerrorPlayer *this;
undefined4 uVar7;
longdouble lVar8;
float fVar9;
float local_40;
void *local_34 [2];
undefined2 local_2c;
ushort local_2a;
void *local_28 [2];
undefined2 local_20;
ushort local_1e;
cVar3 = (**(code **)(*(int *)param_2 + 0x16c))(param_2);
if (cVar3 == '\0') {
return;
}
cVar3 = (**(code **)(*(int *)param_2 + 0x16c))(param_2);
if (cVar3 == '\0') {
return;
}
uVar1 = *(uint *)(param_1 + 0x478);
if ((((uVar1 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar5 + 4) != 0)) {
return;
}
local_34[0] = (void *)0x0;
local_2a = 0;
local_2c = 0;
/* try { // try from 00902b40 to 00902b42 has its CatchHandler @ 00902de5 */
puVar6 = (undefined4 *)(**(code **)(*(int *)param_2 + 0xc))(param_2);
local_28[0] = (void *)*puVar6;
local_1e = 0;
local_20 = 0xd;
*(void **)(param_1 + 0x478) = local_28[0];
/* try { // try from 00902b80 to 00902b82 has its CatchHandler @ 00902dc8 */
(**(code **)(*g_pScriptVM + 0x78))
(g_pScriptVM,*(undefined4 *)(param_1 + 1000),"PlayerUsingMe",local_28);
if ((local_1e & 1) != 0) {
free(local_28[0]);
}
piVar2 = g_pScriptVM;
if ((*(int *)(param_1 + 0x468) != 0) && (param_1[0x474] == (CBaseEntity)0x0)) {
param_1[0x474] = (CBaseEntity)0x1;
/* try { // try from 00902bdf to 00902d27 has its CatchHandler @ 00902de5 */
(**(code **)(*piVar2 + 0x50))
(piVar2,*(int *)(param_1 + 0x468),0,0,local_34,*(undefined4 *)(param_1 + 1000),1);
param_1[0x474] = (CBaseEntity)0x0;
if ((char)local_34[0] == '\0') {
*(undefined4 *)(param_1 + 0x478) = 0xffffffff;
goto joined_r0x00902d9e;
}
}
COutputEvent::FireOutput((COutputEvent *)(param_1 + 0x47c),(CBaseEntity *)param_2,param_1,0.0);
CBaseEntity::SetNextThink(param_1,*(float *)(gpGlobals + 0xc),(char *)0x0);
puVar5 = g_pEntityList;
uVar1 = *(uint *)(param_1 + 0x478);
this = (CTerrorPlayer *)0x0;
local_40 = *(float *)(param_1 + 0x454);
*(undefined4 *)(param_1 + 0x458) = *(undefined4 *)(param_1 + 0x450);
if (((uVar1 != 0xffffffff) &&
(puVar5 = puVar5 + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
this = *(CTerrorPlayer **)(puVar5 + 4);
}
CVar4 = (CBaseEntity)CTerrorPlayer::IsAdrenalineActive(this);
param_1[0x464] = CVar4;
if (CVar4 == (CBaseEntity)0x0) {
fVar9 = *(float *)(param_1 + 0x458);
}
else {
fVar9 = *(float *)(param_1 + 0x458) * 0.5;
local_40 = local_40 * 0.5;
*(float *)(param_1 + 0x458) = fVar9;
}
uVar1 = *(uint *)(param_1 + 0x460);
uVar7 = 0;
if (((uVar1 != 0xffffffff) &&
(puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar5 + 8) == uVar1 >> 0xc)) {
uVar7 = *(undefined4 *)(puVar5 + 4);
}
CTerrorPlayer::StartUseAction(param_2,0xb,uVar7,fVar9,0.0 < fVar9);
lVar8 = (longdouble)CCSPlayer::GetProgressBarStartTime((CCSPlayer *)param_2);
CCSPlayer::SetProgressBarStartTime((CCSPlayer *)param_2,(float)lVar8 - local_40);
joined_r0x00902d9e:
if ((local_2a & 1) != 0) {
free(local_34[0]);
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.