CModelLoader::Map_UnloadModel
0x0019c030 · 205 bytes · __thiscall
_ZN12CModelLoader15Map_UnloadModelEP7model_t
Decompiled
undefined (2 params)
/* CModelLoader::Map_UnloadModel(model_t*) */
void __thiscall CModelLoader::Map_UnloadModel(CModelLoader *this,model_t *param_1)
{
int iVar1;
int iVar2;
*(uint *)(param_1 + 0x108) = *(uint *)(param_1 + 0x108) & 0xfffffffe;
if ((this != (CModelLoader *)0xffffff98) && (*(void **)(this + 0xfc) != (void *)0x0)) {
if (g_bHunkAllocLightmaps == '\0') {
free(*(void **)(this + 0xfc));
}
*(undefined4 *)(this + 0xfc) = 0;
}
Map_UnloadCubemapSamples(this,param_1);
if (*(void **)(this + 0xd4) != (void *)0x0) {
DispInfo_DeleteArray(*(void **)(this + 0xd4));
*(undefined4 *)(this + 0xd4) = 0;
}
iVar1 = 0;
iVar2 = 0;
if (0 < *(int *)(this + 0xc0)) {
do {
if (iVar1 + *(int *)(this + 0xc4) != 0) {
GL_UnloadMaterial(*(IMaterial **)(iVar1 + *(int *)(this + 0xc4) + 0x4c));
}
iVar2 = iVar2 + 1;
iVar1 = iVar1 + 0x50;
} while (iVar2 < *(int *)(this + 0xc0));
}
MaterialSystem_DestroySortinfo();
ClearWorldModel(this);
/* WARNING: Could not recover jumptable at 0x0019c0ee. Too many branches */
/* WARNING: Treating indirect jump as call */
(**(code **)(*(int *)this + 0x38))();
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.