Skip to content

Commit

Permalink
Fix crowbar not showing in weapon list if there are empty weapon slot…
Browse files Browse the repository at this point in the history
…s with a lower id

Resolves ValveSoftware/halflife#3181
  • Loading branch information
SamVanheer committed Dec 2, 2021
1 parent e2eadc6 commit ffe7362
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion cl_dll/ammo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ void CHudAmmo::Think()
{
WEAPON* p = gWR.GetWeapon(i);

if (p)
if (p && WEAPON_NONE != p->iId)
{
if ((gHUD.m_iWeaponBits & (1 << p->iId)) != 0)
gWR.PickupWeapon(p);
Expand Down
22 changes: 21 additions & 1 deletion dlls/cdll_dll.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,28 @@ constexpr int MAX_PLAYERS = 32;
#define HUD_PRINTTALK 3
#define HUD_PRINTCENTER 4

enum WeaponId
{
WEAPON_NONE = 0,
WEAPON_CROWBAR,
WEAPON_GLOCK,
WEAPON_PYTHON,
WEAPON_MP5,
WEAPON_CHAINGUN,
WEAPON_CROSSBOW,
WEAPON_SHOTGUN,
WEAPON_RPG,
WEAPON_GAUSS,
WEAPON_EGON,
WEAPON_HORNETGUN,
WEAPON_HANDGRENADE,
WEAPON_TRIPMINE,
WEAPON_SATCHEL,
WEAPON_SNARK,

WEAPON_SUIT = 31
};

#define WEAPON_SUIT 31

// used by suit voice to indicate damage sustained and repaired type to player

Expand Down
20 changes: 0 additions & 20 deletions dlls/weapons.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,7 @@ class CGrenade : public CBaseMonster
#define ITEM_SECURITY 3
#define ITEM_BATTERY 4

#define WEAPON_NONE 0
#define WEAPON_CROWBAR 1
#define WEAPON_GLOCK 2
#define WEAPON_PYTHON 3
#define WEAPON_MP5 4
#define WEAPON_CHAINGUN 5
#define WEAPON_CROSSBOW 6
#define WEAPON_SHOTGUN 7
#define WEAPON_RPG 8
#define WEAPON_GAUSS 9
#define WEAPON_EGON 10
#define WEAPON_HORNETGUN 11
#define WEAPON_HANDGRENADE 12
#define WEAPON_TRIPMINE 13
#define WEAPON_SATCHEL 14
#define WEAPON_SNARK 15

#define WEAPON_ALLWEAPONS (~(1 << WEAPON_SUIT))

#define WEAPON_SUIT 31 // ?????

#define MAX_NORMAL_BATTERY 100


Expand Down

0 comments on commit ffe7362

Please sign in to comment.