L L4D2node

CModelLoader::UnloadAllModels

0x0019c1e0 · 201 bytes · __thiscall

_ZN12CModelLoader15UnloadAllModelsEbb

Decompiled

undefined (3 params)

/* CModelLoader::UnloadAllModels(bool, bool) */

void __thiscall CModelLoader::UnloadAllModels(CModelLoader *this,bool param_1,bool param_2)

{
  model_t *pmVar1;
  uint uVar2;
  int iVar3;
  int iVar4;
  
  iVar3 = 1;
  iVar4 = *(ushort *)(this + 0x16) + 1;
  if (*(ushort *)(this + 0x16) != 0) {
    do {
      while( true ) {
        pmVar1 = *(model_t **)((iVar3 + 0xfffffff) * 0x10 + *(int *)(this + 8) + 0xc);
        uVar2 = *(uint *)(pmVar1 + 0x108);
        if (!param_1) break;
        if ((uVar2 & 0x3e) == 0) goto LAB_0019c251;
        if ((param_2) && (*(int *)(pmVar1 + 0x110) == 3)) {
          (**(code **)(*g_pMDLCache + 0x90))(g_pMDLCache,*(undefined2 *)(pmVar1 + 0x134));
        }
LAB_0019c228:
        iVar3 = iVar3 + 1;
        if (iVar3 == iVar4) {
          return;
        }
      }
      uVar2 = uVar2 & 0xffffffc1;
      *(uint *)(pmVar1 + 0x108) = uVar2;
LAB_0019c251:
      if ((uVar2 & 0x10001) == 0) goto LAB_0019c228;
      iVar3 = iVar3 + 1;
      UnloadModel(this,pmVar1);
    } while (iVar3 != iVar4);
  }
  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)