L L4D2node

CCSPlayer::Weapon_CanSwitchTo

0x006512a0 · 79 bytes · __thiscall

_ZN9CCSPlayer18Weapon_CanSwitchToEP17CBaseCombatWeapon

Decompiled

undefined (2 params)

/* CCSPlayer::Weapon_CanSwitchTo(CBaseCombatWeapon*) */

undefined4 __thiscall CCSPlayer::Weapon_CanSwitchTo(CCSPlayer *this,CBaseCombatWeapon *param_1)

{
  undefined4 uVar1;
  int iVar2;
  int *piVar3;
  
  uVar1 = (**(code **)(*(int *)param_1 + 0x420))(param_1);
  if ((char)uVar1 != '\0') {
    iVar2 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
    if (iVar2 != 0) {
      piVar3 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this);
                    /* WARNING: Could not recover jumptable at 0x006512f5. Too many branches */
                    /* WARNING: Treating indirect jump as call */
      uVar1 = (**(code **)(*piVar3 + 0x418))();
      return uVar1;
    }
  }
  return uVar1;
}

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)