Skip to content

Commit

Permalink
Improve API compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dystopm committed Jul 29, 2023
1 parent 139642c commit 612c522
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions regamedll/dlls/weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -815,13 +815,13 @@ BOOL CanAttack(float attack_time, float curtime, BOOL isPredicted)
bool CBasePlayerWeapon::HasSecondaryAttack()
{
#ifdef REGAMEDLL_API
if (CSPlayerWeapon()->m_iStateSecondaryAttack != CCSPlayerWeapon::WEAPON_SECONDARY_ATTACK_NONE)
if (CSPlayerWeapon()->m_iStateSecondaryAttack != WEAPON_SECONDARY_ATTACK_NONE)
{
switch (CSPlayerWeapon()->m_iStateSecondaryAttack)
{
case CCSPlayerWeapon::WEAPON_SECONDARY_ATTACK_SET:
case WEAPON_SECONDARY_ATTACK_SET:
return true;
case CCSPlayerWeapon::WEAPON_SECONDARY_ATTACK_BLOCK:
case WEAPON_SECONDARY_ATTACK_BLOCK:
return false;
default:
break;
Expand Down
15 changes: 7 additions & 8 deletions regamedll/public/regamedll/API/CSPlayerWeapon.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@

#pragma once

enum SecondaryAtkState : uint8_t
{
WEAPON_SECONDARY_ATTACK_NONE = 0,
WEAPON_SECONDARY_ATTACK_SET,
WEAPON_SECONDARY_ATTACK_BLOCK
};

class CBasePlayerWeapon;
class CCSPlayerWeapon: public CCSPlayerItem
{
Expand All @@ -45,14 +52,6 @@ class CCSPlayerWeapon: public CCSPlayerItem

CBasePlayerWeapon *BasePlayerWeapon() const;

public:
enum SecondaryAtkState : uint8_t
{
WEAPON_SECONDARY_ATTACK_NONE = 0,
WEAPON_SECONDARY_ATTACK_SET,
WEAPON_SECONDARY_ATTACK_BLOCK
};

public:
SecondaryAtkState m_iStateSecondaryAttack;
float m_flBaseDamage;
Expand Down

0 comments on commit 612c522

Please sign in to comment.