CM_BrushContents_r
0x00119320 · 214 bytes · __cdecl
_Z18CM_BrushContents_rP17CCollisionBSPDatai
Decompiled
undefined (2 params)
/* CM_BrushContents_r(CCollisionBSPData*, int) */
uint CM_BrushContents_r(CCollisionBSPData *param_1,int param_2)
{
uint uVar1;
int iVar2;
int iVar3;
uint uVar4;
int iVar5;
uVar4 = 0;
if (-1 < param_2) {
uVar4 = 0;
do {
iVar2 = *(int *)param_1 + param_2 * 0xc;
uVar1 = CM_BrushContents_r(param_1,*(int *)(iVar2 + 4));
uVar4 = uVar4 | uVar1;
param_2 = *(uint *)(iVar2 + 8);
} while (-1 < param_2);
}
if (*(int *)(param_1 + 0x9c) <= ~param_2) {
Error("Cannot load corrupted map.\n");
}
iVar2 = ~param_2 * 0x10 + *(int *)(param_1 + 0x98);
if (*(short *)(iVar2 + 10) != 0) {
iVar5 = 0;
do {
iVar3 = (uint)*(ushort *)(iVar2 + 8) + iVar5;
if (*(int *)(param_1 + 0xb0) <= iVar3) {
Error("Cannot load corrupted map.\n");
}
uVar1 = (uint)*(ushort *)(*(int *)(param_1 + 0xac) + iVar3 * 2);
if (*(int *)(param_1 + 200) <= (int)uVar1) {
Error("Cannot load corrupted map.\n");
}
iVar5 = iVar5 + 1;
uVar4 = uVar4 | *(uint *)(*(int *)(param_1 + 0xc4) + uVar1 * 8);
} while (iVar5 < (int)(uint)*(ushort *)(iVar2 + 10));
}
return uVar4;
}
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.