L L4D2node

CTerrorPlayer::Weapon_Equip

0x009d6350 · 224 bytes · __thiscall

_ZN13CTerrorPlayer12Weapon_EquipEP17CBaseCombatWeapon

Decompiled

undefined (2 params)

/* CTerrorPlayer::Weapon_Equip(CBaseCombatWeapon*) */

void __thiscall CTerrorPlayer::Weapon_Equip(CTerrorPlayer *this,CBaseCombatWeapon *param_1)

{
  char cVar1;
  uint uVar2;
  CBaseCombatWeapon *pCVar3;
  CTerrorPlayer *pCVar4;
  
  cVar1 = (**(code **)(*(int *)this + 300))(this);
  if (cVar1 != '\0') {
    uVar2 = (**(code **)(*(int *)param_1 + 0x530))(param_1);
    pCVar3 = (CBaseCombatWeapon *)(**(code **)(*(int *)this + 0x484))(this,uVar2);
    if (pCVar3 != (CBaseCombatWeapon *)0x0) {
      CCSPlayer::CSWeaponDrop((CCSPlayer *)this,pCVar3,false,true,(Vector *)0x0);
    }
    CCollisionProperty::SetSolidFlags((CCollisionProperty *)(param_1 + 0x194),4);
    (**(code **)(*(int *)param_1 + 0x50))(param_1,this);
    CBasePlayer::Weapon_Equip((CBasePlayer *)this,param_1);
    pCVar4 = (CTerrorPlayer *)CBaseCombatWeapon::GetOwner(param_1);
    if ((this == pCVar4) && (((byte)param_1[0x14c] & 1) == 0)) {
      OnWeaponPickedUp(this,param_1);
    }
    if (uVar2 < 2) {
      (**(code **)(*(int *)this + 0x474))(this,param_1,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)