L L4D2node

Mod_ComputeTranslucencyType

0x00199e50 · 270 bytes · __cdecl

_Z27Mod_ComputeTranslucencyTypeP7model_tii

Decompiled

undefined (3 params)

/* Mod_ComputeTranslucencyType(model_t*, int, int) */

int Mod_ComputeTranslucencyType(model_t *param_1,int param_2,int param_3)

{
  int *piVar1;
  char cVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int local_21c [131];
  
  iVar3 = 1;
  iVar4 = *(int *)(param_1 + 0x110);
  if (iVar4 != 2) {
    if (iVar4 == 3) {
      iVar4 = (**(code **)(*g_pMDLCache + 0x28))(g_pMDLCache,*(undefined2 *)(param_1 + 0x134));
      if ((*(byte *)(iVar4 + 0x98) & 4) == 0) {
        iVar3 = (**(code **)(*g_pStudioRender + 0xa4))
                          (g_pStudioRender,*(undefined2 *)(param_1 + 0x134),param_2,param_3,0x80,
                           local_21c);
        if (0 < iVar3) {
          iVar5 = 0;
          while ((piVar1 = (int *)local_21c[iVar5], piVar1 == (int *)0x0 ||
                 (cVar2 = (**(code **)(*piVar1 + 0x44))(piVar1), cVar2 == '\0'))) {
            iVar5 = iVar5 + 1;
            if (iVar5 == iVar3) {
              return 0;
            }
          }
          return 2 - (uint)((*(uint *)(iVar4 + 0x98) & 8) == 0);
        }
      }
    }
    else if (iVar4 == 1) {
      if ((*(uint *)(param_1 + 0x114) & 2) == 0) {
        return 0;
      }
      return 2 - (uint)((*(uint *)(param_1 + 0x114) & 8) == 0);
    }
    iVar3 = 0;
  }
  return iVar3;
}

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)