L L4D2node

CModelLoader::Studio_UnloadModel

0x0019aeb0 · 182 bytes · __thiscall

_ZN12CModelLoader18Studio_UnloadModelEP7model_t

Decompiled

undefined (2 params)

/* CModelLoader::Studio_UnloadModel(model_t*) */

void __thiscall CModelLoader::Studio_UnloadModel(CModelLoader *this,model_t *param_1)

{
  IMaterial *pIVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  IMaterial *local_21c [131];
  
  uVar3 = *(uint *)(param_1 + 0x108);
  if ((uVar3 & 0x20000) != 0) {
    iVar2 = Mod_GetModelMaterials(param_1,0x80,local_21c);
    if (0 < iVar2) {
      iVar4 = 0;
      do {
        pIVar1 = local_21c[iVar4];
        iVar4 = iVar4 + 1;
        (**(code **)(*(int *)pIVar1 + 0x34))(pIVar1);
      } while (iVar4 != iVar2);
    }
    uVar3 = *(uint *)(param_1 + 0x108) & 0xfffdffff;
  }
  *(uint *)(param_1 + 0x108) = uVar3 & 0xfffefffe;
  (**(code **)(*g_pMDLCache + 0x20))(g_pMDLCache,*(undefined2 *)(param_1 + 0x134));
  *(undefined2 *)(param_1 + 0x134) = 0xffff;
  *(undefined4 *)(param_1 + 0x110) = 0;
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)