L L4D2node

CModelRender::ProtectColorDataIfQueued

0x00187910 · 199 bytes · __thiscall

_ZN12CModelRender24ProtectColorDataIfQueuedEP13memhandle_t__

Decompiled

undefined (2 params)

/* CModelRender::ProtectColorDataIfQueued(memhandle_t__*) */

void __thiscall CModelRender::ProtectColorDataIfQueued(CModelRender *this,memhandle_t__ *param_1)

{
  code *pcVar1;
  int *piVar2;
  undefined4 *puVar3;
  int iVar4;
  undefined4 *puVar5;
  
  if (param_1 != (memhandle_t__ *)0x0) {
    piVar2 = (int *)(**(code **)(*materials + 0x180))(materials);
    if (piVar2 != (int *)0x0) {
                    /* try { // try from 00187940 to 00187942 has its CatchHandler @ 001879ec */
      (**(code **)(*piVar2 + 8))(piVar2);
    }
                    /* try { // try from 0018794b to 001879b0 has its CatchHandler @ 001879d7 */
    puVar3 = (undefined4 *)(**(code **)(*piVar2 + 0x238))(piVar2);
    if (puVar3 != (undefined4 *)0x0) {
      iVar4 = (**(code **)(**(int **)(this + 8) + 0x28))(*(int **)(this + 8),param_1);
      if (iVar4 != 0) {
        pcVar1 = *(code **)*puVar3;
        puVar5 = operator_new(0x20);
        puVar5[3] = 1;
        *puVar5 = &PTR_AddRef_002b6b28;
        puVar5[2] = &PTR__CMemberFunctor1_002b6b44;
        puVar5[4] = CManagedDataCacheClient<CColorMeshData,colormeshparams_t,CColorMeshData*>::
                    CacheUnlock;
        puVar5[5] = 0;
        puVar5[6] = this;
        puVar5[7] = param_1;
        (*pcVar1)(puVar3,puVar5);
      }
    }
    if (piVar2 != (int *)0x0) {
      (**(code **)(*piVar2 + 0xc))(piVar2);
      if (piVar2 != (int *)0x0) {
        (**(code **)(*piVar2 + 4))(piVar2);
      }
    }
  }
  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)