TankIdle::OnInjured
0x00aef3b0 · 485 bytes · __cdecl
_ZN8TankIdle9OnInjuredEP4TankRK15CTakeDamageInfo
Decompiled
undefined (2 params)
/* TankIdle::OnInjured(Tank*, CTakeDamageInfo const&) */
Tank * TankIdle::OnInjured(Tank *param_1,CTakeDamageInfo *param_2)
{
int *piVar1;
code *pcVar2;
char cVar3;
uint uVar4;
int iVar5;
TankAttack *this;
int *piVar6;
undefined4 uVar7;
undefined *puVar8;
int in_stack_0000000c;
int in_stack_00000010;
uVar4 = *(uint *)(in_stack_00000010 + 0x34);
if ((*(byte *)(in_stack_00000010 + 0x48) & 8) != 0) {
if (uVar4 == 0xffffffff) goto LAB_00aef421;
puVar8 = g_pEntityList + (uVar4 & 0xfff) * 0x10;
if (((puVar8 != (undefined *)0xfffffffc) && (*(uint *)(puVar8 + 8) == uVar4 >> 0xc)) &&
(piVar1 = *(int **)(puVar8 + 4), piVar1 != (int *)0x0)) {
cVar3 = (**(code **)(*piVar1 + 0x16c))(piVar1);
if ((cVar3 != '\0') &&
(piVar6 = (int *)(**(code **)(*gameeventmanager + 0x1c))
(gameeventmanager,"zombie_ignited",0,0), piVar6 != (int *)0x0))
{
pcVar2 = *(code **)(*piVar6 + 0x30);
uVar7 = (**(code **)(*engine + 0x40))(engine,piVar1[0xc]);
(*pcVar2)(piVar6,"userid",uVar7);
if (*(int *)(in_stack_0000000c + 0x30) == 0) {
iVar5 = 0;
}
else {
iVar5 = *(int *)(in_stack_0000000c + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
(**(code **)(*piVar6 + 0x30))(piVar6,"entityid",iVar5);
(**(code **)(*piVar6 + 0x3c))(piVar6,"victimname","Tank");
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar6,0);
}
uVar4 = *(uint *)(in_stack_00000010 + 0x34);
}
}
if (((uVar4 != 0xffffffff) &&
(puVar8 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar8 + 8) == uVar4 >> 0xc &&
(*(CBaseEntity **)(puVar8 + 4) != (CBaseEntity *)0x0)))) {
iVar5 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(puVar8 + 4));
cVar3 = IsASurvivorTeam(iVar5);
if (cVar3 != '\0') {
this = ::operator_new(0x487c);
/* try { // try from 00aef47c to 00aef480 has its CatchHandler @ 00aef5a4 */
TankAttack::TankAttack(this);
*(undefined4 *)param_1 = 1;
*(TankAttack **)(param_1 + 4) = this;
*(char **)(param_1 + 8) = "Ouch!";
*(undefined4 *)(param_1 + 0xc) = 3;
return param_1;
}
}
LAB_00aef421:
*(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.