CModelLoader::EndOfLoadingPurgeUnusedModels
0x0019c320 · 137 bytes · __thiscall
_ZN12CModelLoader29EndOfLoadingPurgeUnusedModelsEv
Decompiled
undefined (1 param)
/* CModelLoader::EndOfLoadingPurgeUnusedModels() */
void __thiscall CModelLoader::EndOfLoadingPurgeUnusedModels(CModelLoader *this)
{
ushort uVar1;
int iVar2;
int iVar3;
int iVar4;
iVar3 = Host_GetServerCount();
iVar4 = 0;
uVar1 = *(ushort *)(this + 0x16);
if (uVar1 != 0) {
do {
iVar2 = *(int *)(iVar4 * 0x10 + *(int *)(this + 8) + 0xc);
if (((*(uint *)(iVar2 + 0x108) & 1) != 0) && (iVar3 != *(int *)(iVar2 + 0x10c))) {
*(uint *)(iVar2 + 0x108) = *(uint *)(iVar2 + 0x108) & 0xffffffc1;
}
iVar4 = iVar4 + 1;
} while (iVar4 < (int)(uint)uVar1);
}
UnloadAllModels(this,true,true);
(**(code **)(*materials + 0x108))(materials,1);
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.