CM_LoadMap
0x0011b4d0 · 243 bytes · __cdecl
_Z10CM_LoadMapPKcbP9texinfo_siPj
Decompiled
undefined (5 params)
/* CM_LoadMap(char const*, bool, texinfo_s*, int, unsigned int*) */
undefined4 CM_LoadMap(char *param_1,bool param_2,texinfo_s *param_3,int param_4,uint *param_5)
{
int iVar1;
iVar1 = strcmp(&DAT_00394304,param_1);
if ((iVar1 == 0) && (param_2)) {
*param_5 = 0xffffffff;
}
else {
CollisionBSPData_PreLoad((CCollisionBSPData *)&g_BSPData);
if ((param_1 != (char *)0x0) && (*param_1 != '\0')) {
CMapLoadHelper::Init((model_t *)0x0,param_1);
CollisionBSPData_Load(param_1,(CCollisionBSPData *)&g_BSPData,param_3,param_4);
CMapLoadHelper::Shutdown();
CM_DispTreeLeafnum((CCollisionBSPData *)&g_BSPData);
CM_InitPortalOpenState((CCollisionBSPData *)&g_BSPData);
FloodAreaConnections((CCollisionBSPData *)&g_BSPData);
if (0 < DAT_003943bc) {
return DAT_003943b8;
}
goto LAB_0011b543;
}
*param_5 = 0;
}
if (0 < DAT_003943bc) {
return DAT_003943b8;
}
LAB_0011b543:
Error("Cannot load corrupted map.\n");
return DAT_003943b8;
}
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.