L L4D2node

CItem::Spawn

0x006e4130 · 329 bytes · __thiscall

_ZN5CItem5SpawnEv

Decompiled

undefined (1 param)

/* CItem::Spawn() */

void __thiscall CItem::Spawn(CItem *this)

{
  char cVar1;
  
  CBaseEntity::SetNetworkQuantizeOriginAngAngles((CBaseEntity *)this,true);
  cVar1 = (**(code **)(*g_pGameRules + 0xb0))(g_pGameRules,this);
  if (cVar1 == '\0') {
    UTIL_Remove((CBaseEntity *)this);
    return;
  }
  CBaseEntity::SetMoveType((CBaseEntity *)this,5,0);
  CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),2);
  CBaseEntity::SetBlocksLOS((CBaseEntity *)this,false);
  *(uint *)(this + 0x14c) = *(uint *)(this + 0x14c) | 0x200000;
  CBaseEntity::SetCollisionGroup((CBaseEntity *)this,0xb);
  cVar1 = (**(code **)(*(int *)this + 0x3a4))(this);
  if (cVar1 != '\0') {
    CCollisionProperty::UseTriggerBounds((CCollisionProperty *)(this + 0x194),true,1.0);
  }
  *(code **)(this + 0xd8) = ItemTouch;
  *(undefined4 *)(this + 0xdc) = 0;
  cVar1 = (**(code **)(*(int *)this + 0x3bc))(this);
  if (cVar1 != '\0') {
    if (this[0x105] != (CItem)0x1) {
      (**(code **)(*(int *)this + 0x224))(this,this + 0x105);
      this[0x105] = (CItem)0x1;
    }
    if (((byte)this[0x148] & 1) == 0) {
      CBaseEntity::NetworkQuantize((CBaseEntity *)this);
      return;
    }
    ConstrainItem(this);
    CBaseEntity::NetworkQuantize((CBaseEntity *)this);
    return;
  }
  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)