L L4D2node

CWorldItem::Spawn

0x006e36f0 · 326 bytes · __thiscall

_ZN10CWorldItem5SpawnEv

Decompiled

undefined (1 param)

/* CWorldItem::Spawn() */

void __thiscall CWorldItem::Spawn(CWorldItem *this)

{
  CBaseEdict *pCVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  
  iVar2 = *(int *)(this + 0x13f4);
  if (iVar2 == 0x2c) {
    iVar2 = CBaseEntity::Create("item_battery",(Vector *)(this + 0x39c),(QAngle *)(this + 0x3a8),
                                (CBaseEntity *)0x0);
LAB_006e373e:
    if (iVar2 != 0) {
      *(undefined4 *)(iVar2 + 0xf8) = *(undefined4 *)(this + 0xf8);
      *(undefined4 *)(iVar2 + 0x154) = *(undefined4 *)(this + 0x154);
      if (*(int *)(iVar2 + 0x148) != 0) {
        if (*(char *)(iVar2 + 0x6c) == '\0') {
          pCVar1 = *(CBaseEdict **)(iVar2 + 0x30);
          if (pCVar1 != (CBaseEdict *)0x0) {
            *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
            iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
            *(undefined2 *)(iVar4 + 2) = 0;
          }
        }
        else {
          *(byte *)(iVar2 + 0x70) = *(byte *)(iVar2 + 0x70) | 1;
        }
        *(undefined4 *)(iVar2 + 0x148) = 0;
      }
      iVar4 = *(int *)(this + 0x148);
      if (iVar4 != 0) {
        if (*(char *)(iVar2 + 0x6c) == '\0') {
          pCVar1 = *(CBaseEdict **)(iVar2 + 0x30);
          if (pCVar1 != (CBaseEdict *)0x0) {
            *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
            iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
            *(undefined2 *)(iVar3 + 2) = 0;
          }
        }
        else {
          *(byte *)(iVar2 + 0x70) = *(byte *)(iVar2 + 0x70) | 1;
        }
        *(int *)(iVar2 + 0x148) = iVar4;
      }
      goto LAB_006e379d;
    }
    iVar2 = *(int *)(this + 0x13f4);
  }
  else if (iVar2 == 0x2d) {
    iVar2 = CBaseEntity::Create("item_suit",(Vector *)(this + 0x39c),(QAngle *)(this + 0x3a8),
                                (CBaseEntity *)0x0);
    goto LAB_006e373e;
  }
  Warning("unable to create world_item %d\n",iVar2);
LAB_006e379d:
  UTIL_RemoveImmediate((CBaseEntity *)this);
  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)