CFogVolume::FindFogVolumeForPosition
0x008d0fc0 · 329 bytes · __cdecl
_ZN10CFogVolume24FindFogVolumeForPositionERK6Vector
Decompiled
undefined (1 param)
/* CFogVolume::FindFogVolumeForPosition(Vector const&) */
int CFogVolume::FindFogVolumeForPosition(Vector *param_1)
{
int iVar1;
int iVar2;
char cVar3;
float *pfVar4;
Vector *pVVar5;
Vector *pVVar6;
matrix3x4_t *pmVar7;
int iVar8;
float local_28;
float local_24;
float local_20;
if (0 < DAT_01003e88) {
iVar8 = 0;
do {
iVar2 = *(int *)(TheFogVolumes + iVar8 * 4);
iVar1 = iVar2 + 0x194;
if ((((*(byte *)(iVar2 + 0x1b4) & 0x40) == 0) && ((*(byte *)(iVar2 + 0x1b6) & 0xfd) != 0)) &&
((pfVar4 = (float *)(**(code **)(*(int *)(iVar2 + 0x194) + 0x24))(iVar1),
vec3_angle != *pfVar4 || ((DAT_01053d40 != pfVar4[1] || (DAT_01053d44 != pfVar4[2])))))) {
pmVar7 = (matrix3x4_t *)(**(code **)(*(int *)(iVar2 + 0x194) + 0x28))(iVar1);
VectorITransform((float *)param_1,pmVar7,&local_28);
}
else {
pfVar4 = (float *)(**(code **)(*(int *)(iVar2 + 0x194) + 0x20))(iVar1);
local_28 = *(float *)param_1 - *pfVar4;
local_24 = *(float *)(param_1 + 4) - pfVar4[1];
local_20 = *(float *)(param_1 + 8) - pfVar4[2];
}
pVVar5 = (Vector *)(**(code **)(*(int *)(iVar2 + 0x194) + 8))(iVar1);
pVVar6 = (Vector *)(**(code **)(*(int *)(iVar2 + 0x194) + 4))(iVar1);
cVar3 = IsBoxIntersectingSphere(pVVar6,pVVar5,(Vector *)&local_28,1.0);
if (cVar3 != '\0') {
return iVar2;
}
iVar8 = iVar8 + 1;
} while (iVar8 < DAT_01003e88);
}
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.