InfectedBehavior::OnInjured
0x00a2fdd0 · 607 bytes · __cdecl
_ZN16InfectedBehavior9OnInjuredEP8InfectedRK15CTakeDamageInfo
Decompiled
undefined (2 params)
/* InfectedBehavior::OnInjured(Infected*, CTakeDamageInfo const&) */
Infected * InfectedBehavior::OnInjured(Infected *param_1,CTakeDamageInfo *param_2)
{
uint uVar1;
char cVar2;
undefined4 *puVar3;
undefined4 *puVar4;
int iVar5;
undefined4 uVar6;
undefined *puVar7;
CBaseEntity *this;
CBaseEntity *in_stack_0000000c;
int in_stack_00000010;
cVar2 = (**(code **)(*(int *)in_stack_0000000c + 300))();
if ((cVar2 != '\0') && (*(int *)(ZombieInvulnerability._28_4_ + 0x30) == 0)) {
if (((*(int *)(in_stack_0000000c + 0x1838) == 1) &&
(iVar5 = CBaseEntity::GetGender(in_stack_0000000c), iVar5 != 0x11)) &&
((iVar5 = CBaseEntity::GetGender(in_stack_0000000c), iVar5 != 0xe ||
(cVar2 = Infected::IsNeutral((Infected *)in_stack_0000000c), cVar2 != '\0')))) {
uVar6 = (**(code **)(*(int *)in_stack_0000000c + 0x5bc))();
*(undefined4 *)param_1 = 1;
*(undefined4 *)(param_1 + 4) = uVar6;
*(undefined4 *)(param_1 + 8) = 0;
*(undefined4 *)(param_1 + 0xc) = 3;
return param_1;
}
if ((*(byte *)(in_stack_00000010 + 0x4b) & 0x20) != 0) {
uVar1 = *(uint *)(in_stack_00000010 + 0x30);
this = (CBaseEntity *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
this = *(CBaseEntity **)(puVar7 + 4);
}
if (((byte)in_stack_0000000c[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(in_stack_0000000c);
}
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this);
}
if ((*(float *)(this + 0x2e8) - *(float *)(in_stack_0000000c + 0x2e8)) *
(*(float *)(this + 0x2e8) - *(float *)(in_stack_0000000c + 0x2e8)) +
(*(float *)(this + 0x2e0) - *(float *)(in_stack_0000000c + 0x2e0)) *
(*(float *)(this + 0x2e0) - *(float *)(in_stack_0000000c + 0x2e0)) +
(*(float *)(this + 0x2e4) - *(float *)(in_stack_0000000c + 0x2e4)) *
(*(float *)(this + 0x2e4) - *(float *)(in_stack_0000000c + 0x2e4)) < 62500.0) {
puVar3 = ::operator_new(0x48);
puVar3[8] = 0;
puVar3[9] = 0;
puVar3[10] = 0;
puVar3[3] = 0;
puVar3[4] = 0;
puVar3[5] = 0;
puVar3[6] = 0;
puVar3[7] = 0;
puVar3[2] = 0;
*(undefined1 *)(puVar3 + 0xc) = 0;
*(undefined1 *)((int)puVar3 + 0x31) = 0;
puVar3[0xb] = 0;
*puVar3 = &PTR__InfectedShoved_00d21b88;
puVar3[1] = &PTR__InfectedShoved_00d21cec;
puVar3[0xd] = 0xffffffff;
/* try { // try from 00a2ff65 to 00a2ff77 has its CatchHandler @ 00a3004a */
puVar4 = (undefined4 *)(**(code **)(*(int *)this + 0xc))(this);
puVar3[0xd] = *puVar4;
puVar4 = (undefined4 *)(**(code **)(*(int *)this + 0x288))(this);
uVar6 = *puVar4;
*(undefined4 *)param_1 = 2;
*(undefined4 **)(param_1 + 4) = puVar3;
puVar3[0xe] = uVar6;
uVar6 = puVar4[1];
*(undefined4 *)(param_1 + 8) = 0;
*(undefined4 *)(param_1 + 0xc) = 1;
puVar3[0xf] = uVar6;
uVar6 = puVar4[2];
puVar3[0x11] = 0;
puVar3[0x10] = uVar6;
return param_1;
}
}
}
*(undefined4 *)param_1 = 0;
*(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.