L L4D2node

CBasePlayer::SelectItem

0x00416ed0 · 156 bytes · __thiscall

_ZN11CBasePlayer10SelectItemEPKci

Decompiled

undefined (3 params)

/* CBasePlayer::SelectItem(char const*, int) */

void __thiscall CBasePlayer::SelectItem(CBasePlayer *this,char *param_1,int param_2)

{
  char cVar1;
  int iVar2;
  int iVar3;
  int *piVar4;
  
  if ((((param_1 != (char *)0x0) &&
       (iVar2 = CBaseCombatCharacter::Weapon_OwnsThisType
                          ((CBaseCombatCharacter *)this,param_1,param_2), iVar2 != 0)) &&
      (iVar3 = (**(code **)(*(int *)this + 0x648))(this), iVar3 == 0)) &&
     (cVar1 = (**(code **)(*(int *)this + 0x5d4))(this,iVar2), cVar1 != '\0')) {
    iVar2 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
    if (iVar2 != 0) {
      piVar4 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
      cVar1 = (**(code **)(*piVar4 + 0x418))(piVar4);
      if (cVar1 == '\0') {
        return;
      }
      ResetAutoaim(this);
    }
                    /* WARNING: Could not recover jumptable at 0x00416f71. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    (**(code **)(*(int *)this + 0x474))();
    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)