L L4D2node

CDirectorItemManager::UpdateItems

0x008a56b0 · 795 bytes · __thiscall

_ZN20CDirectorItemManager11UpdateItemsEv

Decompiled

undefined (1 param)

/* CDirectorItemManager::UpdateItems() */

void __thiscall CDirectorItemManager::UpdateItems(CDirectorItemManager *this)

{
  char cVar1;
  int iVar2;
  longdouble lVar3;
  float local_10;
  
  if (*(int *)(director_debug_scavenge_items._28_4_ + 0x30) == 0) {
    iVar2 = *(int *)(DirectorConvertPills._28_4_ + 0x30);
  }
  else {
    DrawItems<CHandle<CBaseEntity>>(this,"PILLS",(EntityPopulationInfo *)(this + 0x2c));
    DrawItems<CHandle<CBaseEntity>>(this,"MOLOTOV",(EntityPopulationInfo *)(this + 0x60));
    DrawItems<CHandle<CBaseEntity>>(this,"AMMO",(EntityPopulationInfo *)(this + 0x94));
    DrawItems<CHandle<CBaseEntity>>(this,"PIPE BOMB",(EntityPopulationInfo *)(this + 200));
    DrawItems<CHandle<CBaseEntity>>(this,"PISTOL",(EntityPopulationInfo *)(this + 0xfc));
    DrawItems<CHandle<CBaseEntity>>(this,"MAGNUM",(EntityPopulationInfo *)(this + 0x130));
    DrawItems<CHandle<CBaseEntity>>(this,"GAS CAN",(EntityPopulationInfo *)(this + 0x164));
    DrawItems<CHandle<CBaseEntity>>(this,"O2 TANK",(EntityPopulationInfo *)(this + 0x1cc));
    DrawItems<CHandle<CBaseEntity>>(this,"PROPANE TANK",(EntityPopulationInfo *)(this + 0x198));
    DrawItems<CHandle<CBaseEntity>>(this,"MELEE WEAPON",(EntityPopulationInfo *)(this + 0x200));
    DrawItems<CHandle<CBaseEntity>>(this,"ADRENALINE",(EntityPopulationInfo *)(this + 0x234));
    DrawItems<CHandle<CBaseEntity>>(this,"DEFIBRILLATOR",(EntityPopulationInfo *)(this + 0x268));
    DrawItems<CHandle<CBaseEntity>>(this,"VOMIT JAR",(EntityPopulationInfo *)(this + 0x29c));
    DrawItems<CHandle<CBaseEntity>>(this,"UPGRADE",(EntityPopulationInfo *)(this + 0x2d0));
    DrawItems<CHandle<CBaseEntity>>(this,"UPGRADEPACK",(EntityPopulationInfo *)(this + 0x304));
    DrawItems<CHandle<CBaseEntity>>(this,"CHAINSAW",(EntityPopulationInfo *)(this + 0x338));
    DrawItems<CHandle<CBaseEntity>>(this,"GRENADE LAUNCHER",(EntityPopulationInfo *)(this + 0x36c));
    DrawItems<CHandle<CBaseEntity>>(this,"M60",(EntityPopulationInfo *)(this + 0x3a0));
    DrawItems<CHandle<CBaseEntity>>(this,"WEAPONSPAWN",(EntityPopulationInfo *)(this + 0x3d4));
    iVar2 = *(int *)(DirectorConvertPills._28_4_ + 0x30);
  }
  if ((((iVar2 != 0) && (iVar2 = GetDifficulty(), iVar2 != 3)) &&
      (cVar1 = CTerrorGameRules::HasPlayerControlledZombies(), cVar1 == '\0')) &&
     ((cVar1 = CDirectorChallengeMode::AllowPillConversion
                         (*(CDirectorChallengeMode **)(TheDirector + 0x648)), cVar1 != '\0' &&
      (0.0 < *(float *)(this + 0xc))))) {
    lVar3 = (longdouble)CountdownTimer::Now();
    if ((*(float *)(this + 0xc) <= (float)lVar3) &&
       (iVar2 = CDirector::GetHealthkitConversionMode(TheDirector,&local_10), iVar2 == 1)) {
      DynamicConvertPillsToKits(this);
      lVar3 = (longdouble)CountdownTimer::Now();
      if ((float)lVar3 + 5.0 != *(float *)(this + 0xc)) {
        (**(code **)(*(int *)(this + 4) + 4))(this + 4,this + 0xc);
        *(float *)(this + 0xc) = (float)lVar3 + 5.0;
      }
      if (*(float *)(this + 8) != 5.0) {
        (**(code **)(*(int *)(this + 4) + 4))(this + 4,this + 8);
        *(undefined4 *)(this + 8) = 0x40a00000;
      }
    }
  }
  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)