L L4D2node

CBasePlayer::RemovePlayerItem

0x007b3290 · 239 bytes · __thiscall

_ZN11CBasePlayer16RemovePlayerItemEP17CBaseCombatWeapon

Decompiled

undefined (2 params)

/* CBasePlayer::RemovePlayerItem(CBaseCombatWeapon*) */

void __thiscall CBasePlayer::RemovePlayerItem(CBasePlayer *this,CBaseCombatWeapon *param_1)

{
  uint uVar1;
  CBaseCombatWeapon *pCVar2;
  undefined *puVar3;
  undefined1 local_24 [20];
  
  pCVar2 = (CBaseCombatWeapon *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
  if (pCVar2 == param_1) {
    ResetAutoaim(this);
    (**(code **)(*(int *)param_1 + 0x428))(param_1,0);
    CBaseEntity::SetNextThink((CBaseEntity *)param_1,-1.0,(char *)0x0);
    CBaseEntity::ThinkSet((_func_void *)local_24,(float)param_1,(char *)0x0);
  }
  uVar1 = *(uint *)(this + 0x2064);
  if (((uVar1 == 0xffffffff) ||
      (puVar3 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar3 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar3 + 8) != uVar1 >> 0xc)) {
    if (param_1 != (CBaseCombatWeapon *)0x0) goto LAB_007b32de;
  }
  else if (param_1 != *(CBaseCombatWeapon **)(puVar3 + 4)) goto LAB_007b32de;
  (**(code **)(*(int *)this + 0x5cc))(this,0);
LAB_007b32de:
  CBaseCombatCharacter::Weapon_Detach((CBaseCombatCharacter *)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)