WitchIdle::OnInjured
0x00a3fd60 · 728 bytes · __cdecl
_ZN9WitchIdle9OnInjuredEP8InfectedRK15CTakeDamageInfo
Decompiled
undefined (2 params)
/* WitchIdle::OnInjured(Infected*, CTakeDamageInfo const&) */
Infected * WitchIdle::OnInjured(Infected *param_1,CTakeDamageInfo *param_2)
{
uint uVar1;
char cVar2;
undefined4 *puVar3;
undefined4 *puVar4;
WitchAttack *pWVar5;
CBaseEntity *pCVar6;
undefined *puVar7;
Witch *in_stack_0000000c;
int in_stack_00000010;
if (((50.0 < *(float *)(in_stack_00000010 + 0x3c)) &&
((*(byte *)(in_stack_00000010 + 0x48) & 2) != 0)) &&
(*(int *)(in_stack_0000000c + 0x1838) == 1)) {
uVar1 = *(uint *)(in_stack_00000010 + 0x34);
pCVar6 = (CBaseEntity *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
pCVar6 = *(CBaseEntity **)(puVar7 + 4);
}
cVar2 = WitchAttack::IsValidEnemy(pCVar6);
if (cVar2 != '\0') {
Witch::ChangeRageLevel(in_stack_0000000c,1.0);
CBaseEntity::EmitSound
((CBaseEntity *)in_stack_0000000c,"WitchZombie.HeadShot",0.0,(float *)0x0);
uVar1 = *(uint *)(in_stack_00000010 + 0x34);
if (((uVar1 == 0xffffffff) ||
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar7 + 8) != uVar1 >> 0xc)) {
pCVar6 = (CBaseEntity *)0x0;
}
else {
pCVar6 = *(CBaseEntity **)(puVar7 + 4);
}
pWVar5 = ::operator_new(0x487c);
/* try { // try from 00a3fead to 00a3feb1 has its CatchHandler @ 00a40064 */
WitchAttack::WitchAttack(pWVar5,pCVar6);
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;
if (pCVar6 == (CBaseEntity *)0x0) {
puVar3[0xe] = vec3_origin;
puVar3[0xf] = DAT_01053d4c;
puVar3[0x10] = DAT_01053d50;
}
else {
/* try { // try from 00a3ff2f to 00a3ff41 has its CatchHandler @ 00a40079 */
puVar4 = (undefined4 *)(**(code **)(*(int *)pCVar6 + 0xc))(pCVar6);
puVar3[0xd] = *puVar4;
puVar4 = (undefined4 *)(**(code **)(*(int *)pCVar6 + 0x288))(pCVar6);
puVar3[0xe] = *puVar4;
puVar3[0xf] = puVar4[1];
puVar3[0x10] = puVar4[2];
}
*(undefined4 *)param_1 = 2;
*(undefined4 **)(param_1 + 4) = puVar3;
*(char **)(param_1 + 8) = "Reacting to high-powered rifle headshot";
*(undefined4 *)(param_1 + 0xc) = 2;
puVar3[0x11] = pWVar5;
return param_1;
}
}
uVar1 = *(uint *)(in_stack_00000010 + 0x34);
if (((((uVar1 == 0xffffffff) ||
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar7 + 8) != uVar1 >> 0xc)) ||
((pCVar6 = *(CBaseEntity **)(puVar7 + 4), pCVar6 == (CBaseEntity *)0x0 ||
(cVar2 = (**(code **)(*(int *)pCVar6 + 0x16c))(pCVar6), cVar2 == '\0')))) ||
((cVar2 = WitchAttack::IsValidEnemy(pCVar6), cVar2 == '\0' ||
((cVar2 = IsInCommentaryMode(), cVar2 != '\0' &&
(cVar2 = (**(code **)(*(int *)pCVar6 + 0x778))(pCVar6), cVar2 == '\0')))))) {
*(undefined4 *)param_1 = 0;
*(undefined4 *)(param_1 + 4) = 0;
*(undefined4 *)(param_1 + 8) = 0;
*(undefined4 *)(param_1 + 0xc) = 1;
}
else {
pWVar5 = ::operator_new(0x487c);
/* try { // try from 00a3ffdc to 00a3ffe0 has its CatchHandler @ 00a40052 */
WitchAttack::WitchAttack(pWVar5,pCVar6);
*(undefined4 *)param_1 = 2;
*(WitchAttack **)(param_1 + 4) = pWVar5;
*(char **)(param_1 + 8) = "Attacking Survivor that injured me";
*(undefined4 *)(param_1 + 0xc) = 2;
}
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.