L L4D2node

CGameServer::GetModel

0x0020a2d0 · 177 bytes · __thiscall

_ZN11CGameServer8GetModelEi

Decompiled

undefined (2 params)

/* CGameServer::GetModel(int) */

model_t * __thiscall CGameServer::GetModel(CGameServer *this,int param_1)

{
  int *piVar1;
  int iVar2;
  model_t *pmVar3;
  undefined4 uVar4;
  
  if ((0 < param_1) && (piVar1 = *(int **)(this + 0x2d364), piVar1 != (int *)0x0)) {
    iVar2 = (**(code **)(*piVar1 + 0x10))(piVar1);
    if (param_1 < iVar2) {
      pmVar3 = (model_t *)CPrecacheItem::GetModel((CPrecacheItem *)(this + param_1 * 8 + 0x264));
      if (pmVar3 == (model_t *)0x0) {
        uVar4 = (**(code **)(**(int **)(this + 0x2d364) + 0x28))(*(int **)(this + 0x2d364),param_1);
        if (*(int *)(host_showcachemiss._28_4_ + 0x30) != 0) {
          ConDMsg("server model cache miss on %s\n",uVar4);
        }
        pmVar3 = (model_t *)(**(code **)(*(int *)modelloader + 0x1c))(modelloader,uVar4,2);
        CPrecacheItem::SetModel((CPrecacheItem *)(this + param_1 * 8 + 0x264),pmVar3);
      }
      return pmVar3;
    }
  }
  return (model_t *)0x0;
}

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)