L L4D2node

CTriggerSoundscape::PlayerUpdateThink

0x0082fc00 · 681 bytes · __thiscall

_ZN18CTriggerSoundscape17PlayerUpdateThinkEv

Decompiled

undefined (1 param)

/* CTriggerSoundscape::PlayerUpdateThink() */

void __thiscall CTriggerSoundscape::PlayerUpdateThink(CTriggerSoundscape *this)

{
  CUtlVector<CHandle<CBasePlayer>,CUtlMemory<CHandle<CBasePlayer>,int>> *this_00;
  undefined4 uVar1;
  uint uVar2;
  int *piVar3;
  char cVar4;
  CBaseEntity *pCVar5;
  undefined4 *puVar6;
  int iVar7;
  undefined *puVar8;
  int iVar9;
  undefined4 local_38;
  undefined4 local_34;
  int local_30 [8];
  
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.2,(char *)0x0);
  iVar9 = *(int *)(this + 0x580);
  this_00 = (CUtlVector<CHandle<CBasePlayer>,CUtlMemory<CHandle<CBasePlayer>,int>> *)(this + 0x574);
  local_30[0] = 0;
  local_30[1] = 0;
  local_30[2] = 0;
  local_30[3] = 0;
  local_30[4] = 0;
  if (iVar9 != 0) {
    CUtlVector<CHandle<CBasePlayer>,CUtlMemory<CHandle<CBasePlayer>,int>>::GrowVector
              ((CUtlVector<CHandle<CBasePlayer>,CUtlMemory<CHandle<CBasePlayer>,int>> *)local_30,
               iVar9);
    CUtlVector<CHandle<CBasePlayer>,CUtlMemory<CHandle<CBasePlayer>,int>>::ShiftElementsRight
              ((CUtlVector<CHandle<CBasePlayer>,CUtlMemory<CHandle<CBasePlayer>,int>> *)local_30,0,
               iVar9);
    if (0 < iVar9) {
      iVar7 = 0;
      do {
        puVar6 = (undefined4 *)(local_30[0] + iVar7 * 4);
        if (puVar6 != (undefined4 *)0x0) {
          *puVar6 = 0xffffffff;
        }
        iVar7 = iVar7 + 1;
      } while (iVar7 != iVar9);
      iVar7 = 0;
      do {
        *(undefined4 *)(local_30[0] + iVar7 * 4) =
             *(undefined4 *)(*(int *)(this + 0x574) + iVar7 * 4);
        iVar7 = iVar7 + 1;
      } while (iVar7 != iVar9);
    }
  }
  *(undefined4 *)(this + 0x580) = 0;
  if (0 < *(int *)(gpGlobals + 0x14)) {
    iVar9 = 1;
    do {
                    /* try { // try from 0082fcb4 to 0082fe69 has its CatchHandler @ 0082febb */
      while (((pCVar5 = (CBaseEntity *)UTIL_PlayerByIndex(iVar9), pCVar5 == (CBaseEntity *)0x0 ||
              (cVar4 = (**(code **)(*(int *)pCVar5 + 300))(pCVar5), cVar4 != '\0')) ||
             (cVar4 = CBaseEntity::Intersects((CBaseEntity *)this,pCVar5), cVar4 == '\0'))) {
LAB_0082fca0:
        iVar9 = iVar9 + 1;
        if (*(int *)(gpGlobals + 0x14) < iVar9) goto LAB_0082fd70;
      }
      local_38 = 0xffffffff;
      puVar6 = (undefined4 *)(**(code **)(*(int *)pCVar5 + 0xc))(pCVar5);
      local_38 = *puVar6;
      iVar7 = CUtlVector<CHandle<CBasePlayer>,CUtlMemory<CHandle<CBasePlayer>,int>>::Find
                        ((CUtlVector<CHandle<CBasePlayer>,CUtlMemory<CHandle<CBasePlayer>,int>> *)
                         local_30,(CHandle *)&local_38);
      if (iVar7 < 0) {
        (**(code **)(*(int *)this + 0x1b0))(this,pCVar5);
      }
      puVar6 = (undefined4 *)(**(code **)(*(int *)pCVar5 + 0xc))(pCVar5);
      uVar1 = *puVar6;
      iVar7 = *(int *)(this + 0x580);
      CUtlVector<CHandle<CBasePlayer>,CUtlMemory<CHandle<CBasePlayer>,int>>::GrowVector(this_00,1);
      CUtlVector<CHandle<CBasePlayer>,CUtlMemory<CHandle<CBasePlayer>,int>>::ShiftElementsRight
                (this_00,iVar7,1);
      puVar6 = (undefined4 *)(*(int *)(this + 0x574) + iVar7 * 4);
      if (puVar6 == (undefined4 *)0x0) goto LAB_0082fca0;
      iVar9 = iVar9 + 1;
      *puVar6 = uVar1;
    } while (iVar9 <= *(int *)(gpGlobals + 0x14));
  }
LAB_0082fd70:
  iVar9 = 0;
  if (0 < local_30[3]) {
    do {
      while (((uVar2 = *(uint *)(local_30[0] + iVar9 * 4), uVar2 == 0xffffffff ||
              (puVar8 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar8 == (undefined *)0xfffffffc))
             || ((*(uint *)(puVar8 + 8) != uVar2 >> 0xc ||
                 (piVar3 = *(int **)(puVar8 + 4), piVar3 == (int *)0x0))))) {
LAB_0082fd80:
        iVar9 = iVar9 + 1;
        if (local_30[3] <= iVar9) goto LAB_0082fe00;
      }
      local_34 = 0xffffffff;
      puVar6 = (undefined4 *)(**(code **)(*piVar3 + 0xc))(piVar3);
      local_34 = *puVar6;
      iVar7 = CUtlVector<CHandle<CBasePlayer>,CUtlMemory<CHandle<CBasePlayer>,int>>::Find
                        (this_00,(CHandle *)&local_34);
      if (-1 < iVar7) goto LAB_0082fd80;
      (**(code **)(*(int *)this + 0x1b8))(this,piVar3);
      iVar9 = iVar9 + 1;
    } while (iVar9 < local_30[3]);
  }
LAB_0082fe00:
  local_30[3] = 0;
  CUtlMemory<CHandle<CBasePlayer>,int>::Purge((CUtlMemory<CHandle<CBasePlayer>,int> *)local_30);
  local_30[4] = local_30[0];
  CUtlMemory<CHandle<CBasePlayer>,int>::Purge((CUtlMemory<CHandle<CBasePlayer>,int> *)local_30);
  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)