SurvivorBehavior::OnInjured
0x009266b0 · 387 bytes · __cdecl
_ZN16SurvivorBehavior9OnInjuredEP11SurvivorBotRK15CTakeDamageInfo
Decompiled
undefined (2 params)
/* SurvivorBehavior::OnInjured(SurvivorBot*, CTakeDamageInfo const&) */
SurvivorBot * SurvivorBehavior::OnInjured(SurvivorBot *param_1,CTakeDamageInfo *param_2)
{
uint uVar1;
char cVar2;
int *piVar3;
undefined4 *puVar4;
int iVar5;
CBaseCombatCharacter *pCVar6;
SurvivorIntention *this;
undefined *puVar7;
int *in_stack_0000000c;
int in_stack_00000010;
piVar3 = (int *)(**(code **)(*in_stack_0000000c + 0x9a0))();
cVar2 = (**(code **)(*piVar3 + 0x114))(piVar3);
if (cVar2 == '\0') {
uVar1 = *(uint *)(in_stack_00000010 + 0x34);
if ((((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) &&
(piVar3 = *(int **)(puVar7 + 4), piVar3 != (int *)0x0)) {
iVar5 = (**(code **)(*piVar3 + 0x14c))(piVar3);
if (iVar5 != 0) {
uVar1 = *(uint *)(in_stack_00000010 + 0x34);
piVar3 = (int *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
piVar3 = *(int **)(puVar7 + 4);
}
pCVar6 = (CBaseCombatCharacter *)(**(code **)(*piVar3 + 0x14c))(piVar3);
this = (SurvivorIntention *)(**(code **)(*in_stack_0000000c + 0x9a8))();
SurvivorIntention::AddThreat(this,pCVar6);
}
}
*(undefined4 *)param_1 = 0;
*(undefined4 *)(param_1 + 4) = 0;
*(undefined4 *)(param_1 + 8) = 0;
*(undefined4 *)(param_1 + 0xc) = 1;
return param_1;
}
puVar4 = ::operator_new(0x34);
*(undefined4 *)param_1 = 2;
puVar4[8] = 0;
puVar4[9] = 0;
puVar4[10] = 0;
puVar4[3] = 0;
puVar4[4] = 0;
puVar4[5] = 0;
puVar4[6] = 0;
puVar4[7] = 0;
puVar4[2] = 0;
*(undefined1 *)(puVar4 + 0xc) = 0;
*(undefined1 *)((int)puVar4 + 0x31) = 0;
puVar4[0xb] = 0;
*puVar4 = &PTR__SurvivorEscapeLadderAmbush_00d01348;
puVar4[1] = &PTR__SurvivorEscapeLadderAmbush_00d014ac;
*(undefined4 **)(param_1 + 4) = puVar4;
*(char **)(param_1 + 8) = "I\'m being attacked while helpless on a ladder!";
*(undefined4 *)(param_1 + 0xc) = 3;
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.