CBaseCombatCharacter::GetFogTrigger
0x005f6f80 · 334 bytes · __thiscall
_ZN20CBaseCombatCharacter13GetFogTriggerEv
Decompiled
undefined (1 param)
/* CBaseCombatCharacter::GetFogTrigger() */
undefined4 __thiscall CBaseCombatCharacter::GetFogTrigger(CBaseCombatCharacter *this)
{
int *piVar1;
uint uVar2;
float *pfVar3;
float *pfVar4;
undefined4 *puVar5;
undefined *puVar6;
int iVar7;
float fVar8;
int *local_28;
float local_24;
iVar7 = 0;
local_28 = (int *)0x0;
local_24 = 999999.0;
if (0 < *(int *)(this + 0x1868)) {
do {
while ((((uVar2 = *(uint *)(*(int *)(this + 0x185c) + iVar7 * 4), uVar2 == 0xffffffff ||
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc))
|| (*(uint *)(puVar6 + 8) != uVar2 >> 0xc)) ||
(piVar1 = *(int **)(puVar6 + 4), piVar1 == (int *)0x0))) {
LAB_005f6fb8:
iVar7 = iVar7 + 1;
if (*(int *)(this + 0x1868) <= iVar7) goto LAB_005f707d;
}
pfVar3 = (float *)(**(code **)(*piVar1 + 0x288))(piVar1);
pfVar4 = (float *)(**(code **)(*(int *)this + 0x288))(this);
fVar8 = SQRT((*pfVar4 - *pfVar3) * (*pfVar4 - *pfVar3) +
(pfVar4[2] - pfVar3[2]) * (pfVar4[2] - pfVar3[2]) +
(pfVar4[1] - pfVar3[1]) * (pfVar4[1] - pfVar3[1]));
if (local_24 <= fVar8) goto LAB_005f6fb8;
iVar7 = iVar7 + 1;
local_28 = piVar1;
local_24 = fVar8;
} while (iVar7 < *(int *)(this + 0x1868));
LAB_005f707d:
if (local_28 != (int *)0x0) {
puVar5 = (undefined4 *)(**(code **)(*local_28 + 0xc))(local_28);
*(undefined4 *)(this + 0x1870) = *puVar5;
}
}
uVar2 = *(uint *)(this + 0x1870);
if (((uVar2 != 0xffffffff) &&
(puVar6 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar6 + 8) == uVar2 >> 0xc)) {
return *(undefined4 *)(puVar6 + 4);
}
return 0;
}
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.