L L4D2node

CModelRender::CreateInstance

0x0018a070 · 283 bytes · __thiscall

_ZN12CModelRender14CreateInstanceEP17IClientRenderablePP20LightCacheHandle_t__

Decompiled

undefined (3 params)

/* CModelRender::CreateInstance(IClientRenderable*, LightCacheHandle_t__**) */

ushort __thiscall
CModelRender::CreateInstance
          (CModelRender *this,IClientRenderable *param_1,LightCacheHandle_t__ **param_2)

{
  ushort uVar1;
  undefined4 uVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  int iVar5;
  uint uVar6;
  
  uVar2 = (**(code **)(*(int *)param_1 + 0x20))(param_1);
  uVar1 = CUtlLinkedList<CModelRender::ModelInstance_t,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CModelRender::ModelInstance_t,unsigned_short>,unsigned_short>>
          ::InsertBefore((CUtlLinkedList<CModelRender::ModelInstance_t,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CModelRender::ModelInstance_t,unsigned_short>,unsigned_short>>
                          *)(this + 0xc),0xffff);
  uVar6 = (uint)uVar1;
  puVar4 = (undefined4 *)(uVar6 * 0x108 + *(int *)(this + 0xc));
  puVar4[1] = uVar2;
  *puVar4 = param_1;
  *(undefined2 *)((int)puVar4 + 0xfa) = 0;
  puVar4[2] = 0;
  puVar4[0x40] = 0;
  puVar4[0x3d] = 0xc97423f0;
  puVar4[0x3f] = 0;
  iVar5 = 6;
  puVar3 = puVar4;
  do {
    puVar3[0x1a] = 0;
    puVar3[0x1b] = 0;
    puVar3[0x1c] = 0;
    iVar5 = iVar5 + -1;
    puVar3 = puVar3 + 3;
  } while (iVar5 != 0);
  puVar4[0x1a] = 0x3f800000;
  puVar4[0x2c] = 0;
  puVar4[0x1d] = 0x3f800000;
  puVar4[0x20] = 0x3f800000;
  puVar4[0x23] = 0x3f800000;
  puVar4[0x26] = 0x3f800000;
  puVar4[0x29] = 0x3f800000;
  if (param_2 != (LightCacheHandle_t__ **)0x0) {
    (**(code **)(*(int *)this + 0x14))(this,uVar6,param_2);
    ValidateStaticPropColorData(this,uVar1);
    (**(code **)(*(int *)this + 0x34))(this,uVar6);
  }
  return uVar1;
}

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)