L L4D2node

CCSPlayer::Weapon_Equip

0x006605e0 · 314 bytes · __thiscall

_ZN9CCSPlayer12Weapon_EquipEP17CBaseCombatWeapon

Decompiled

undefined (2 params)

/* CCSPlayer::Weapon_Equip(CBaseCombatWeapon*) */

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

{
  code *pcVar1;
  CWeaponCSBase *this_00;
  int iVar2;
  undefined4 uVar3;
  CBaseCombatWeapon *pCVar4;
  char *pcVar5;
  
  if (param_1 == (CBaseCombatWeapon *)0x0) goto LAB_0066069c;
  this_00 = (CWeaponCSBase *)
            __dynamic_cast(param_1,&CBaseCombatWeapon::typeinfo,&CWeaponCSBase::typeinfo,0);
  if (this_00 == (CWeaponCSBase *)0x0) goto LAB_0066069c;
  iVar2 = (**(code **)(*(int *)this_00 + 0x530))(this_00);
  if (iVar2 == 0) {
LAB_00660630:
    pcVar1 = *(code **)(*(int *)this + 0x484);
    uVar3 = (**(code **)(*(int *)this_00 + 0x530))(this_00);
    pCVar4 = (CBaseCombatWeapon *)(*pcVar1)(this,uVar3);
    if (pCVar4 != (CBaseCombatWeapon *)0x0) {
      CSWeaponDrop(this,pCVar4,false,true,(Vector *)0x0);
    }
  }
  else {
    iVar2 = (**(code **)(*(int *)this_00 + 0x530))(this_00);
    if (iVar2 == 1) goto LAB_00660630;
    iVar2 = CWeaponCSBase::GetCSWpnData(this_00);
    if (*(int *)(iVar2 + 0x894) == 7) {
      pcVar5 = "";
      if (*(char **)(this_00 + 0x7c) != (char *)0x0) {
        pcVar5 = *(char **)(this_00 + 0x7c);
      }
      iVar2 = CBaseCombatCharacter::Weapon_OwnsThisType((CBaseCombatCharacter *)this,pcVar5,0);
      if (iVar2 != 0) {
        (**(code **)(*(int *)this + 0x46c))(this,param_1);
        UTIL_Remove((CBaseEntity *)this_00);
        return;
      }
    }
  }
  CCollisionProperty::SetSolidFlags((CCollisionProperty *)(this_00 + 0x194),4);
  (**(code **)(*(int *)this_00 + 0x50))(this_00,this);
LAB_0066069c:
  CBasePlayer::Weapon_Equip((CBasePlayer *)this,param_1);
  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)