Witch::OnTakeDamage_Alive
0x00a48680 · 391 bytes · __thiscall
_ZN5Witch18OnTakeDamage_AliveERK15CTakeDamageInfo
Decompiled
undefined (2 params)
/* Witch::OnTakeDamage_Alive(CTakeDamageInfo const&) */
undefined4 __thiscall Witch::OnTakeDamage_Alive(Witch *this,CTakeDamageInfo *param_1)
{
uint uVar1;
CBaseEdict *this_00;
char cVar2;
undefined4 uVar3;
int iVar4;
int iVar5;
undefined *puVar6;
int iVar7;
int iVar8;
CBaseEntity *this_01;
int local_20 [4];
iVar8 = *(int *)(this + 0x100);
uVar3 = NextBotCombatCharacter::OnTakeDamage_Alive((NextBotCombatCharacter *)this,param_1);
iVar5 = *(int *)(this + 0x100);
uVar1 = *(uint *)(param_1 + 0x34);
if ((((uVar1 == 0xffffffff) ||
(puVar6 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar6 + 8) != uVar1 >> 0xc)) ||
((this_01 = *(CBaseEntity **)(puVar6 + 4), this_01 == (CBaseEntity *)0x0 ||
(cVar2 = (**(code **)(*(int *)this_01 + 0x16c))(this_01), cVar2 == '\0')))) {
this_01 = (CBaseEntity *)0x0;
local_20[0] = -1;
}
else {
local_20[0] = (**(code **)(*engine + 0x40))(engine,*(int *)(this_01 + 0x30));
}
if (*(float *)(this + 0x1db0) == -1.0) {
*(undefined4 *)(this + 0x1db0) = *(undefined4 *)(gpGlobals + 0xc);
}
iVar4 = *(int *)(this + 0x1dc0);
if (0 < iVar4) {
if (local_20[0] == **(int **)(this + 0x1db4)) goto LAB_00a48759;
iVar7 = 0;
do {
iVar7 = iVar7 + 1;
if (iVar7 == iVar4) goto LAB_00a48740;
} while (local_20[0] != (*(int **)(this + 0x1db4))[iVar7]);
if (iVar7 != -1) goto LAB_00a48759;
}
LAB_00a48740:
CUtlVector<int,CUtlMemory<int,int>>::InsertBefore
((CUtlVector<int,CUtlMemory<int,int>> *)(this + 0x1db4),iVar4,local_20);
LAB_00a48759:
if (this_01 != (CBaseEntity *)0x0) {
iVar4 = CBaseEntity::GetTeamNumber(this_01);
cVar2 = IsASurvivorTeam(iVar4);
if (cVar2 != '\0') {
*(uint *)(this + 0x1dc8) = *(uint *)(this + 0x1dc8) | *(uint *)(param_1 + 0x48);
}
iVar8 = (iVar8 - iVar5) + *(int *)(this_01 + 0x395c);
if (*(int *)(this_01 + 0x395c) != iVar8) {
if (this_01[0x6c] == (CBaseEntity)0x0) {
this_00 = *(CBaseEdict **)(this_01 + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this_01[0x70] = (CBaseEntity)((byte)this_01[0x70] | 1);
}
*(int *)(this_01 + 0x395c) = iVar8;
}
}
return uVar3;
}
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.