L L4D2node

CBaseAnimatingOverlay::SetLayerCycle

0x005ecbc0 · 385 bytes · __thiscall

_ZN21CBaseAnimatingOverlay13SetLayerCycleEiff

Decompiled

undefined (4 params)

/* CBaseAnimatingOverlay::SetLayerCycle(int, float, float) */

void __thiscall
CBaseAnimatingOverlay::SetLayerCycle
          (CBaseAnimatingOverlay *this,int param_1,float param_2,float param_3)

{
  float fVar1;
  undefined4 uVar2;
  CBaseEdict *pCVar3;
  int iVar4;
  int iVar5;
  byte *pbVar6;
  int iVar7;
  
  if ((-1 < param_1) && (param_1 < *(int *)(this + 0x1400))) {
    iVar7 = param_1 * 0x4c;
    pbVar6 = (byte *)(*(int *)(this + 0x13f4) + iVar7);
    if ((*pbVar6 & 1) != 0) {
      if (pbVar6[5] == 0) {
        if (param_2 <= 0.0) {
          param_2 = 0.0;
        }
        if (param_3 <= 0.0) {
          param_3 = 0.0;
        }
        if (1.0 <= param_2) {
          param_2 = 1.0;
        }
        if (1.0 <= param_3) {
          param_3 = 1.0;
        }
      }
      if (param_2 == *(float *)(pbVar6 + 0xc)) {
        fVar1 = *(float *)(pbVar6 + 0x10);
        iVar5 = gpGlobals;
      }
      else {
        iVar5 = *(int *)(pbVar6 + 0x48);
        if (iVar5 != 0) {
          if (*(char *)(iVar5 + 0x6c) == '\0') {
            pCVar3 = *(CBaseEdict **)(iVar5 + 0x30);
            if (pCVar3 != (CBaseEdict *)0x0) {
              *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
              iVar4 = CBaseEdict::GetChangeAccessor(pCVar3);
              *(undefined2 *)(iVar4 + 2) = 0;
            }
          }
          else {
            *(byte *)(iVar5 + 0x70) = *(byte *)(iVar5 + 0x70) | 1;
          }
          uVar2 = *(undefined4 *)(gpGlobals + 0xc);
          *(undefined4 *)(iVar5 + 0x78) = 0;
          *(undefined4 *)(iVar5 + 0x74) = uVar2;
        }
        *(float *)(pbVar6 + 0xc) = param_2;
        pbVar6 = (byte *)(*(int *)(this + 0x13f4) + iVar7);
        fVar1 = *(float *)(pbVar6 + 0x10);
        iVar5 = gpGlobals;
      }
      gpGlobals = iVar5;
      if (param_3 != fVar1) {
        iVar4 = *(int *)(pbVar6 + 0x48);
        if (iVar4 != 0) {
          if (*(char *)(iVar4 + 0x6c) == '\0') {
            pCVar3 = *(CBaseEdict **)(iVar4 + 0x30);
            if (pCVar3 != (CBaseEdict *)0x0) {
              *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
              iVar5 = CBaseEdict::GetChangeAccessor(pCVar3);
              *(undefined2 *)(iVar5 + 2) = 0;
            }
          }
          else {
            *(byte *)(iVar4 + 0x70) = *(byte *)(iVar4 + 0x70) | 1;
          }
          iVar5 = gpGlobals;
          uVar2 = *(undefined4 *)(gpGlobals + 0xc);
          *(undefined4 *)(iVar4 + 0x78) = 0;
          *(undefined4 *)(iVar4 + 0x74) = uVar2;
        }
        *(float *)(pbVar6 + 0x10) = param_3;
        pbVar6 = (byte *)(*(int *)(this + 0x13f4) + iVar7);
      }
      *(float *)(pbVar6 + 0x40) = param_3;
      *(undefined4 *)(*(int *)(this + 0x13f4) + 0x44 + iVar7) = *(undefined4 *)(iVar5 + 0xc);
    }
  }
  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)