SurvivorAttack::OnInjured
0x009184b0 · 189 bytes · __cdecl
_ZN14SurvivorAttack9OnInjuredEP11SurvivorBotRK15CTakeDamageInfo
Decompiled
undefined (2 params)
/* SurvivorAttack::OnInjured(SurvivorBot*, CTakeDamageInfo const&) */
SurvivorBot * SurvivorAttack::OnInjured(SurvivorBot *param_1,CTakeDamageInfo *param_2)
{
float fVar1;
uint uVar2;
int iVar3;
undefined *puVar4;
longdouble lVar5;
int in_stack_00000010;
uVar2 = *(uint *)(in_stack_00000010 + 0x34);
if ((((uVar2 != 0xffffffff) &&
(puVar4 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar4 + 8) == uVar2 >> 0xc)) &&
(*(CBaseEntity **)(puVar4 + 4) != (CBaseEntity *)0x0)) {
iVar3 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(puVar4 + 4));
if (iVar3 == 3) {
*(int *)(param_2 + 100) = *(int *)(param_2 + 100) + 1;
lVar5 = (longdouble)CountdownTimer::Now();
fVar1 = *(float *)(param_2 + 0x6c);
if ((float)lVar5 + fVar1 != *(float *)(param_2 + 0x70)) {
(**(code **)(*(int *)(param_2 + 0x68) + 4))(param_2 + 0x68,param_2 + 0x70);
*(float *)(param_2 + 0x70) = (float)lVar5 + fVar1;
}
}
}
*(undefined4 *)param_1 = 4;
*(undefined4 *)(param_1 + 4) = 0;
*(undefined4 *)(param_1 + 8) = 0;
*(undefined4 *)(param_1 + 0xc) = 1;
return param_1;
}
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.