SurvivorHealFriend::OnInjured
0x00933150 · 410 bytes · __cdecl
_ZN18SurvivorHealFriend9OnInjuredEP11SurvivorBotRK15CTakeDamageInfo
Decompiled
undefined (2 params)
/* SurvivorHealFriend::OnInjured(SurvivorBot*, CTakeDamageInfo const&) */
SurvivorBot * SurvivorHealFriend::OnInjured(SurvivorBot *param_1,CTakeDamageInfo *param_2)
{
uint uVar1;
code *pcVar2;
int iVar3;
CBaseEntity *pCVar4;
undefined4 uVar5;
undefined *puVar6;
int in_GS_OFFSET;
longdouble lVar7;
CTerrorPlayer *in_stack_0000000c;
int in_stack_00000010;
CAI_Concept local_134 [8];
CFmtStrN<256> local_12c [268];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
uVar1 = *(uint *)(in_stack_00000010 + 0x34);
if ((((uVar1 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar1 >> 0xc)) &&
(*(CBaseEntity **)(puVar6 + 4) != (CBaseEntity *)0x0)) {
iVar3 = CBaseEntity::GetTeamNumber(*(CBaseEntity **)(puVar6 + 4));
if (iVar3 == 3) {
lVar7 = (longdouble)CTerrorPlayer::GetProgressBarPercent(in_stack_0000000c);
if ((float)lVar7 < 0.5) {
uVar1 = *(uint *)(param_2 + 0x34);
if (((uVar1 == 0xffffffff) ||
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) {
pCVar4 = (CBaseEntity *)0x0;
}
else {
pCVar4 = *(CBaseEntity **)(puVar6 + 4);
}
uVar5 = DescribeSubject(pCVar4);
CFmtStrN<256>::CFmtStrN(local_12c,"Subject:%s",uVar5);
pcVar2 = *(code **)(*(int *)in_stack_0000000c + 0x7b4);
CAI_Concept::CAI_Concept(local_134,"SurvivorBotAttackedWhileHealingFriend");
(*pcVar2)();
*(undefined4 *)param_1 = 3;
*(undefined4 *)(param_1 + 4) = 0;
*(char **)(param_1 + 8) = "Attacked while healing friend";
*(undefined4 *)(param_1 + 0xc) = 2;
goto LAB_009331b8;
}
}
}
*(undefined4 *)param_1 = 0;
*(undefined4 *)(param_1 + 4) = 0;
*(undefined4 *)(param_1 + 8) = 0;
*(undefined4 *)(param_1 + 0xc) = 1;
LAB_009331b8:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return param_1;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.