CM_GetAreaPortalPlane
0x0011b9f0 · 349 bytes · __cdecl
_Z21CM_GetAreaPortalPlaneRK6VectoriP6VPlane
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CM_GetAreaPortalPlane(Vector const&, int, VPlane*) */
undefined4 CM_GetAreaPortalPlane(Vector *param_1,int param_2,VPlane *param_3)
{
ushort *puVar1;
undefined4 *puVar2;
int iVar3;
int iVar4;
int *piVar5;
iVar3 = 0;
if ((DAT_0039437c != 0) &&
(iVar3 = CM_PointLeafnum_r((CCollisionBSPData *)&g_BSPData,param_1,0), iVar3 < 0)) {
return 0;
}
if (iVar3 < DAT_00394394) {
if (DAT_0039439c <= iVar3) {
Error("Cannot load corrupted map.\n");
}
iVar3 = (int)((short)(*(short *)(iVar3 * 0x10 + DAT_00394398 + 6) << 7) >> 7);
if ((-1 < iVar3) && (iVar3 < DAT_00394524)) {
if (DAT_0039452c <= iVar3) {
Error("Cannot load corrupted map.\n");
}
piVar5 = (int *)(iVar3 * 0x10 + DAT_00394528);
if (0 < *piVar5) {
iVar3 = 0;
do {
iVar4 = iVar3 + piVar5[1];
if ((iVar4 < 0) || (_DAT_00394538 <= iVar4)) {
Error("Cannot load corrupted map.\n");
}
puVar1 = (ushort *)(_DAT_00394534 + iVar4 * 0xc);
if ((uint)*puVar1 == param_2) {
iVar3 = *(int *)(puVar1 + 4);
if ((iVar3 < 0) || (_DAT_00394384 <= iVar3)) {
Error("Cannot load corrupted map.\n");
}
puVar2 = (undefined4 *)(DAT_00394380 + iVar3 * 0x14);
*(undefined4 *)param_3 = *puVar2;
*(undefined4 *)(param_3 + 4) = puVar2[1];
*(undefined4 *)(param_3 + 8) = puVar2[2];
*(undefined4 *)(param_3 + 0xc) = puVar2[3];
return 1;
}
iVar3 = iVar3 + 1;
} while (iVar3 < *piVar5);
}
}
}
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.