CTerrorPlayer::OnUseEntity
0x00996eb0 · 304 bytes · __cdecl
_ZN13CTerrorPlayer11OnUseEntityEP11CBaseEntity8USE_TYPE
Decompiled
undefined (2 params)
/* CTerrorPlayer::OnUseEntity(CBaseEntity*, USE_TYPE) */
void CTerrorPlayer::OnUseEntity(CBaseEntity *param_1,int *param_2)
{
code *pcVar1;
char cVar2;
int iVar3;
CBaseEntity *pCVar4;
int *piVar5;
undefined4 uVar6;
if (param_2 != (int *)0x0) {
iVar3 = CBaseEntity::GetTeamNumber(param_1);
cVar2 = IsASurvivorTeam(iVar3);
if (cVar2 != '\0') {
pCVar4 = (CBaseEntity *)TheTutor();
piVar5 = param_2;
Tutor::OnUseEntity(pCVar4);
cVar2 = (**(code **)(*param_2 + 0x16c))(param_2,piVar5);
if (cVar2 == '\0') {
iVar3 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)param_1);
if (((iVar3 == 0) || (*(char *)(iVar3 + 0x1459) == '\0')) &&
(param_1[0x33bd] == (CBaseEntity)0x0)) {
(**(code **)(*(int *)param_1 + 0x7fc))(param_1,0x40,0);
piVar5 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"player_use",0,0)
;
if (piVar5 != (int *)0x0) {
pcVar1 = *(code **)(*piVar5 + 0x30);
uVar6 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(param_1 + 0x30));
(*pcVar1)(piVar5,"userid",uVar6);
if (param_2[0xc] == 0) {
iVar3 = 0;
}
else {
iVar3 = param_2[0xc] - *(int *)(gpGlobals + 0x58) >> 4;
}
(**(code **)(*piVar5 + 0x30))(piVar5,"targetid",iVar3);
/* WARNING: Could not recover jumptable at 0x00996fdb. Too many branches */
/* WARNING: Treating indirect jump as call */
(**(code **)(*gameeventmanager + 0x20))();
return;
}
}
}
}
}
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.