CButtonTimed::UseTimed
0x00637550 · 453 bytes · __cdecl
_ZN12CButtonTimed8UseTimedEP11CBaseEntityS1_8USE_TYPEf
Decompiled
undefined (4 params)
/* CButtonTimed::UseTimed(CBaseEntity*, CBaseEntity*, USE_TYPE, float) */
void CButtonTimed::UseTimed(CBaseButton *param_1,CBaseEntity *param_2)
{
undefined4 uVar1;
uint uVar2;
CBaseCombatCharacter *this;
undefined4 *puVar3;
int iVar4;
int *piVar5;
undefined *puVar6;
undefined4 uVar7;
undefined4 uVar8;
undefined4 uVar9;
undefined4 uVar10;
undefined1 local_24 [20];
if (param_1[0x4f4] != (CBaseButton)0x0) {
CBaseButton::OnUseLocked(param_1,param_2);
return;
}
if (param_2 != (CBaseEntity *)0x0) {
this = (CBaseCombatCharacter *)
__dynamic_cast(param_2,&CBaseEntity::typeinfo,&CTerrorPlayer::typeinfo,0);
if (this != (CBaseCombatCharacter *)0x0) {
if (param_1[0x59d] == (CBaseButton)0x0) {
puVar3 = (undefined4 *)(**(code **)(*(int *)param_2 + 0xc))(param_2);
*(undefined4 *)(param_1 + 0x494) = *puVar3;
COutputEvent::FireOutput
((COutputEvent *)(param_1 + 0x520),param_2,(CBaseEntity *)param_1,0.0);
uVar10 = 0;
uVar9 = 0;
uVar8 = 0;
CBaseEntity::ThinkSet((_func_void *)local_24,(float)param_1,(char *)UseThink);
uVar7 = 0;
CBaseEntity::SetNextThink((CBaseEntity *)param_1,*(float *)(gpGlobals + 0xc),(char *)0x0);
iVar4 = gpGlobals;
param_1[0x59d] = (CBaseButton)0x1;
uVar1 = *(undefined4 *)(iVar4 + 0xc);
*(undefined4 *)(param_1 + 0x5a4) = uVar1;
*(undefined4 *)(param_1 + 0x5a0) = uVar1;
iVar4 = CBaseCombatCharacter::GetActiveWeapon(this);
if ((iVar4 != 0) && (*(char *)(iVar4 + 0x1459) != '\0')) {
piVar5 = (int *)CTerrorPlayer::GetActiveTerrorWeapon((CTerrorPlayer *)this);
if (piVar5 != (int *)0x0) {
(**(code **)(*piVar5 + 0x428))(piVar5,0,uVar7,uVar8,uVar9,uVar10);
(**(code **)(*piVar5 + 0x424))(piVar5);
}
}
CTerrorPlayer::StartUseAction();
return;
}
uVar2 = *(uint *)(param_1 + 0x494);
if ((((uVar2 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) && (param_2 == *(CBaseEntity **)(puVar6 + 4))) {
*(undefined4 *)(param_1 + 0x5a4) = *(undefined4 *)(gpGlobals + 0xc);
}
}
}
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.