CM_BoxVisible
0x0011bc20 · 218 bytes · __cdecl
_Z13CM_BoxVisibleRK6VectorS1_PKhi
Decompiled
undefined (4 params)
/* CM_BoxVisible(Vector const&, Vector const&, unsigned char const*, int) */
undefined4 CM_BoxVisible(Vector *param_1,Vector *param_2,uchar *param_3,int param_4)
{
byte bVar1;
int iVar2;
uint uVar3;
int iVar4;
int iVar5;
int local_420;
int local_41c [259];
iVar5 = 0;
iVar2 = CM_BoxLeafnums(param_1,param_2,local_41c,0x100,&local_420);
if (0 < iVar2) {
do {
uVar3 = CM_LeafCluster(local_41c[iVar5]);
if (uVar3 != 0xffffffff) {
iVar4 = (int)uVar3 >> 3;
if (((int)uVar3 < 0) || (param_4 < iVar4)) {
Sys_Error("CM_BoxVisible: cluster %i, offset %i out of bounds %i\n",uVar3,iVar4,param_4);
bVar1 = param_3[iVar4] >> (uVar3 & 7);
}
else {
bVar1 = param_3[iVar4] >> (uVar3 & 7);
}
if ((bVar1 & 1) != 0) {
return 1;
}
}
iVar5 = iVar5 + 1;
} while (iVar5 != iVar2);
}
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.