CollisionBSPData_LoadAreas
0x00122740 · 321 bytes · __cdecl
_Z26CollisionBSPData_LoadAreasP17CCollisionBSPData
Decompiled
undefined (1 param)
/* CollisionBSPData_LoadAreas(CCollisionBSPData*) */
void CollisionBSPData_LoadAreas(CCollisionBSPData *param_1)
{
undefined4 *puVar1;
uint uVar2;
undefined4 uVar3;
uint uVar4;
undefined4 *puVar5;
uint uVar6;
int in_GS_OFFSET;
CMapLoadHelper local_140 [288];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
CMapLoadHelper::CMapLoadHelper(local_140,0x14);
/* try { // try from 00122779 to 00122825 has its CatchHandler @ 0012287c */
puVar1 = (undefined4 *)CMapLoadHelper::LumpBase(local_140);
uVar2 = CMapLoadHelper::LumpSize(local_140);
if ((uVar2 & 7) != 0) {
Sys_Error("CMod_LoadAreas: funny lump size");
}
uVar2 = CMapLoadHelper::LumpSize(local_140);
uVar2 = uVar2 >> 3;
if (0x100 < uVar2) {
Sys_Error("Map has too many areas");
}
uVar3 = Hunk_AllocName(uVar2 << 4,"map_areas",true);
*(undefined4 *)(param_1 + 0x228) = uVar3;
*(uint *)(param_1 + 0x22c) = uVar2;
*(uint *)(param_1 + 0x224) = uVar2;
uVar4 = uVar2;
uVar6 = 0;
if (uVar2 != 0) {
while( true ) {
if ((int)uVar4 <= (int)uVar6) {
Error("Cannot load corrupted map.\n");
}
puVar5 = (undefined4 *)(uVar6 * 0x10 + *(int *)(param_1 + 0x228));
*puVar5 = *puVar1;
uVar3 = puVar1[1];
puVar5[3] = 0;
puVar5[2] = 0;
puVar5[1] = uVar3;
if (uVar2 == uVar6 + 1) break;
uVar4 = *(uint *)(param_1 + 0x22c);
uVar6 = uVar6 + 1;
puVar1 = puVar1 + 2;
}
}
CMapLoadHelper::~CMapLoadHelper(local_140);
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return;
}
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.