Mod_MarkWaterSurfaces
0x0019a560 · 390 bytes · __cdecl
_Z21Mod_MarkWaterSurfacesP7model_t
Decompiled
undefined (1 param)
/* Mod_MarkWaterSurfaces(model_t*) */
undefined4 Mod_MarkWaterSurfaces(model_t *param_1)
{
undefined4 *puVar1;
model_t *pmVar2;
int iVar3;
undefined4 uVar4;
msurface2_t *pmVar5;
int iVar6;
uint uVar7;
uint local_38;
undefined4 local_30;
float local_28;
float local_24;
float local_20;
pmVar2 = host_state;
CCommonHostState::SetWorldModel((CCommonHostState *)&host_state,param_1);
MarkWaterSurfaces_r(*(mnode_t **)(*(int *)(param_1 + 0x134) + 0x50));
iVar3 = *(int *)(param_1 + 0x134);
if (*(int *)(iVar3 + 0x70) < 1) {
local_30 = 0;
}
else {
iVar6 = 0;
local_30 = 0;
do {
pmVar5 = (msurface2_t *)(iVar6 * 0x20 + *(int *)(iVar3 + 0x78));
uVar7 = *(uint *)pmVar5;
if ((uVar7 & 0x10000) == 0) {
local_38 = 0x800000;
if (((((uVar7 & 0x60000) != 0x60000) && (local_38 = 0x400000, (uVar7 & 0x20000) == 0)) &&
(local_38 = 0, (uVar7 & 0x40000) == 0)) &&
(SurfFlagsToSortGroup(msurface2_t*,int)::warningcount =
SurfFlagsToSortGroup(msurface2_t*,int)::warningcount + 1,
SurfFlagsToSortGroup(msurface2_t*,int)::warningcount < 10)) {
local_38 = 0;
Surf_ComputeCentroid(pmVar5,(Vector *)&local_28);
puVar1 = *(undefined4 **)
((uint)(*(ushort *)(pmVar5 + 0x16) >> 1) * 0x50 + *(int *)(DAT_003a172c + 0x5c)
+ 0x4c);
uVar4 = (**(code **)*puVar1)(puVar1);
DevWarning("SurfFlagsToSortGroup: unhandled flags (%X) (%s)!\n",uVar7,uVar4);
DevWarning(
"- This implies you have a surface (usually a displacement) embedded in solid.\n"
);
DevWarning("- Look near (%.1f, %.1f, %.1f)\n",(double)local_28,(double)local_24,
(double)local_20);
uVar7 = *(uint *)pmVar5;
}
}
else {
local_38 = 0xc00000;
local_30 = 1;
}
iVar6 = iVar6 + 1;
*(uint *)pmVar5 = uVar7 | local_38;
iVar3 = *(int *)(param_1 + 0x134);
} while (iVar6 < *(int *)(iVar3 + 0x70));
}
CCommonHostState::SetWorldModel((CCommonHostState *)&host_state,pmVar2);
return local_30;
}
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.