L L4D2node

CBasePlayer::BumpWeapon

0x007a7f00 · 480 bytes · __thiscall

_ZN11CBasePlayer10BumpWeaponEP17CBaseCombatWeapon

Decompiled

undefined (2 params)

/* CBasePlayer::BumpWeapon(CBaseCombatWeapon*) */

undefined4 __thiscall CBasePlayer::BumpWeapon(CBasePlayer *this,CBaseCombatWeapon *param_1)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  undefined4 uVar4;
  char *pcVar5;
  
  iVar2 = CBaseCombatWeapon::GetOwner(param_1);
  if (this[0x17d9] == (CBasePlayer)0x0) {
    if (((iVar2 == 0) && (cVar1 = (**(code **)(*(int *)this + 0x464))(this,param_1), cVar1 != '\0'))
       && (uVar3 = (**(code **)(*g_pGameRules + 0x14c))(g_pGameRules,this,param_1),
          (char)uVar3 != '\0')) {
      if (*(int *)(hl2_episodic._28_4_ + 0x30) == 0) {
        cVar1 = (**(code **)(*(int *)param_1 + 0x264))(param_1,this,0x200400b,0);
        if ((cVar1 == '\0') && (((byte)this[0x151] & 0x80) == 0)) {
          return 0;
        }
      }
      else {
        cVar1 = UTIL_ItemCanBeTouchedByPlayer((CBaseEntity *)param_1,this);
        if ((cVar1 == '\0') && (gEvilImpulse101 == 0)) {
          return 0;
        }
      }
      iVar2 = (**(code **)(*(int *)param_1 + 0x3a8))(param_1);
      pcVar5 = "";
      if (*(char **)(param_1 + 0x7c) != (char *)0x0) {
        pcVar5 = *(char **)(param_1 + 0x7c);
      }
      iVar2 = CBaseCombatCharacter::Weapon_OwnsThisType((CBaseCombatCharacter *)this,pcVar5,iVar2);
      if (iVar2 == 0) {
        (**(code **)(*(int *)param_1 + 0x5b0))(param_1);
        CCollisionProperty::SetSolidFlags
                  ((CCollisionProperty *)(param_1 + 0x194),(uint)(*(ushort *)(param_1 + 0x1b4) | 4))
        ;
        CBaseEntity::AddEffects((CBaseEntity *)param_1,0x20);
        (**(code **)(*(int *)this + 0x468))(this,param_1);
        uVar4 = (**(code **)(*(int *)this + 0x4fc))(this);
        if ((char)uVar4 != '\0') {
          (**(code **)(*(int *)param_1 + 0x428))(param_1,0);
          return uVar4;
        }
        return uVar3;
      }
      uVar3 = (**(code **)(*(int *)this + 0x46c))(this,param_1);
      if (((char)uVar3 != '\0') &&
         (cVar1 = (**(code **)(*(int *)param_1 + 0x410))(param_1), cVar1 == '\0')) {
        UTIL_Remove((CBaseEntity *)param_1);
        return uVar3;
      }
    }
    else if (gEvilImpulse101 != 0) {
      UTIL_Remove((CBaseEntity *)param_1);
      return 0;
    }
  }
  return 0;
}

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)