L L4D2node

CDirectorScavengeMode::ClearScavengeItem

0x008b42a0 · 497 bytes · __thiscall

_ZN21CDirectorScavengeMode17ClearScavengeItemE7CHandleI11CBaseEntityE

Decompiled

undefined (2 params)

/* CDirectorScavengeMode::ClearScavengeItem(CHandle<CBaseEntity>) */

void __thiscall CDirectorScavengeMode::ClearScavengeItem(CDirectorScavengeMode *this,uint *param_2)

{
  int *piVar1;
  uint uVar2;
  uint uVar3;
  char cVar4;
  int iVar5;
  undefined *puVar6;
  uint *puVar7;
  longdouble lVar8;
  int local_4c;
  int *local_48;
  int local_34;
  int local_30;
  ScavengeClusterSpawned local_1d [13];
  
  cVar4 = CDirectorChallengeMode::SingleScavengeCluster
                    (*(CDirectorChallengeMode **)(TheDirector + 0x648));
  if (cVar4 != '\0') {
    if (*(int *)(this + 0x38) < 1) {
LAB_008b43de:
      iVar5 = *(int *)(this + 0x60);
    }
    else {
      local_4c = 0;
      local_48 = *(int **)(this + 0x2c);
      do {
        local_34 = local_48[3];
        if (0 < local_34) {
          local_30 = 0;
          uVar2 = *param_2;
          piVar1 = (int *)(g_pEntityList + (uVar2 & 0xfff) * 0x10 + 4);
          puVar7 = (uint *)*local_48;
          do {
            iVar5 = 0;
            if (uVar2 != 0xffffffff) {
              if (piVar1 == (int *)0x0) {
                iVar5 = 0;
              }
              else if (piVar1[1] == uVar2 >> 0xc) {
                iVar5 = *piVar1;
              }
            }
            uVar3 = *puVar7;
            if (((uVar3 == 0xffffffff) ||
                (puVar6 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)
                ) || (*(uint *)(puVar6 + 8) != uVar3 >> 0xc)) {
              if (iVar5 == 0) goto LAB_008b43a0;
            }
            else if (iVar5 == *(int *)(puVar6 + 4)) {
LAB_008b43a0:
              iVar5 = (local_34 - local_30) + -1;
              if (0 < iVar5) {
                _V_memmove(puVar7,(uint *)*local_48 + local_30 + 1,iVar5 * 4);
                local_34 = local_48[3];
              }
              local_48[3] = local_34 + -1;
              goto LAB_008b43de;
            }
            local_30 = local_30 + 1;
            puVar7 = puVar7 + 1;
          } while (local_30 != local_34);
        }
        local_4c = local_4c + 1;
        local_48 = local_48 + 5;
      } while (local_4c != *(int *)(this + 0x38));
      iVar5 = *(int *)(this + 0x60);
    }
    if (((-1 < iVar5) && (iVar5 < *(int *)(this + 0x38))) &&
       ((*(int *)(iVar5 * 0x14 + *(int *)(this + 0x2c) + 0xc) == 0 &&
        (cVar4 = SpawnNextScavengeCluster(this), cVar4 != '\0')))) {
      ForEachTerrorPlayer<ScavengeClusterSpawned>(local_1d);
      lVar8 = (longdouble)
              CDirector::GetScriptValue
                        (TheDirector,"ScavengeClusterBonusTime",
                         *(float *)(scavenge_cluster_bonus_time._28_4_ + 0x2c));
      CTerrorGameRules::AccumulateTime(g_pGameRules,(float)lVar8);
    }
  }
  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)