L L4D2node

CDirector::QueueEntitiesToFadeOut

0x00880fb0 · 438 bytes · __thiscall

_ZN9CDirector22QueueEntitiesToFadeOutEv

Decompiled

undefined (1 param)

/* CDirector::QueueEntitiesToFadeOut() */

void __thiscall CDirector::QueueEntitiesToFadeOut(CDirector *this)

{
  int *piVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  undefined *puVar5;
  uint *puVar6;
  CBaseEntity *pCVar7;
  int iVar8;
  longdouble lVar9;
  int local_3c;
  int local_38;
  int local_20;
  
  iVar2 = *(int *)(this + 0x144);
  if (0 < iVar2) {
    local_38 = 0;
    do {
      if (0 < *(int *)(this + 0x158)) {
        local_20 = 0;
        uVar3 = *(uint *)(*(int *)(this + 0x138) + local_38 * 4);
        piVar1 = (int *)(g_pEntityList + (uVar3 & 0xfff) * 0x10 + 4);
        puVar6 = *(uint **)(this + 0x14c);
        do {
          iVar8 = 0;
          if (uVar3 != 0xffffffff) {
            if (piVar1 == (int *)0x0) {
              iVar8 = 0;
            }
            else if (piVar1[1] == uVar3 >> 0xc) {
              iVar8 = *piVar1;
            }
          }
          uVar4 = *puVar6;
          if (((uVar4 == 0xffffffff) ||
              (puVar5 = g_pEntityList + (uVar4 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc))
             || (*(uint *)(puVar5 + 8) != uVar4 >> 0xc)) {
            if (iVar8 == 0) goto joined_r0x008810ba;
          }
          else if (iVar8 == *(int *)(puVar5 + 4)) goto joined_r0x008810ba;
          local_20 = local_20 + 1;
          puVar6 = puVar6 + 3;
        } while (local_20 != *(int *)(this + 0x158));
      }
      local_3c = local_38 * 4;
      lVar9 = (longdouble)RandomFloat(0x41200000,0x41700000);
      uVar3 = *(uint *)(*(int *)(this + 0x138) + local_3c);
      pCVar7 = (CBaseEntity *)0x0;
      if (((uVar3 != 0xffffffff) &&
          (puVar5 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar5 + 8) == uVar3 >> 0xc)) {
        pCVar7 = *(CBaseEntity **)(puVar5 + 4);
      }
      FadeOutAfterDelay(this,pCVar7,(float)lVar9,40.0);
joined_r0x008810ba:
      local_38 = local_38 + 1;
    } while (local_38 != iVar2);
  }
  *(undefined4 *)(this + 0x144) = 0;
  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)