L L4D2node

CModelRender::ChangeInstance

0x00185b90 · 120 bytes · __thiscall

_ZN12CModelRender14ChangeInstanceEtP17IClientRenderable

Decompiled

undefined (3 params)

/* CModelRender::ChangeInstance(unsigned short, IClientRenderable*) */

bool __thiscall
CModelRender::ChangeInstance(CModelRender *this,ushort param_1,IClientRenderable *param_2)

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  
  if (param_1 == 0xffff || param_2 == (IClientRenderable *)0x0) {
    return false;
  }
  puVar3 = (undefined4 *)((uint)param_1 * 0x108 + *(int *)(this + 0xc));
  iVar1 = puVar3[1];
  iVar2 = (**(code **)(*(int *)param_2 + 0x20))(param_2);
  if (iVar1 != iVar2) {
    DevMsg("MoveInstanceHandle: models are different!\n");
    return param_1 == 0xffff || param_2 == (IClientRenderable *)0x0;
  }
  *puVar3 = param_2;
  return true;
}

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)