L L4D2node

CBaseCombatWeapon::Spawn

0x00405d20 · 410 bytes · __thiscall

_ZN17CBaseCombatWeapon5SpawnEv

Decompiled

undefined (1 param)

/* CBaseCombatWeapon::Spawn() */

void __thiscall CBaseCombatWeapon::Spawn(CBaseCombatWeapon *this)

{
  code *pcVar1;
  CBaseEdict *pCVar2;
  undefined4 uVar3;
  int iVar4;
  
  (**(code **)(*(int *)this + 0x6c))(this);
  CCollisionProperty::SetSolid((CCollisionProperty *)(this + 0x194),2);
  *(undefined4 *)(this + 0x1430) = 0;
  *(uint *)(this + 0x14c) = *(uint *)(this + 0x14c) & 0xfffbffff;
  if (*(int *)(this + 0x1414) != 0) {
    if (this[0x6c] == (CBaseCombatWeapon)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBaseCombatWeapon)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x1414) = 0;
  }
  CBaseEntity::SetGlobalFadeScale((CBaseEntity *)this,0.0);
  if (*(int *)(this + 0x13f8) != 0) {
    if (this[0x6c] == (CBaseCombatWeapon)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBaseCombatWeapon)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x13f8) = 0;
  }
  GiveDefaultAmmo(this);
  pcVar1 = *(code **)(*(int *)this + 0x70);
  uVar3 = (**(code **)(*(int *)this + 0x508))(this);
  (*pcVar1)(this,uVar3);
  (**(code **)(*(int *)this + 0x5a4))(this);
  CBaseEntity::SetCollisionGroup((CBaseEntity *)this,0xb);
  if (this[0x105] != (CBaseCombatWeapon)0x1) {
    (**(code **)(*(int *)this + 0x224))(this,this + 0x105);
    this[0x105] = (CBaseCombatWeapon)0x1;
  }
  CBaseEntity::SetBlocksLOS((CBaseEntity *)this,false);
  this[0x1458] = (CBaseCombatWeapon)0x0;
  CCollisionProperty::UseTriggerBounds((CCollisionProperty *)(this + 0x194),true,36.0);
  CBaseEntity::AddEffects((CBaseEntity *)this,0x80);
  *(undefined4 *)(this + 0x1480) = 0;
  *(undefined4 *)(this + 0x147c) = 0;
  *(undefined4 *)(this + 0x148c) = 0;
  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)