Skip to content

Commit

Permalink
weapons: fix playercurrentweapon mistakenly made generic
Browse files Browse the repository at this point in the history
  • Loading branch information
newby committed Jan 19, 2024
1 parent cab7011 commit db7bb2d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions share/weapons.qc
Original file line number Diff line number Diff line change
Expand Up @@ -471,18 +471,21 @@ float self_class();
Slot self_current_slot();
float* self_clip_fired(Slot slot);

float FO_PlayerCurrentWeapon(entity player) {
float FO_CurrentWeapon() {
FO_WeapInfo* wi = FO_SlotWeapInfo(self_class(), self_current_slot());
if (!wi)
return WEAP_NONE;
return wi->weapon;
}

inline float FO_CurrentWeapon() {
return FO_PlayerCurrentWeapon(self);
#ifdef SSQC
float FO_PlayerCurrentWeapon(entity player) {
FO_WeapInfo* wi = FO_SlotWeapInfo(player.playerclass, player.current_slot);
if (!wi)
return WEAP_NONE;
return wi->weapon;
}

#ifdef SSQC
struct FO_WeapState {
float weapon;
Slot slot;
Expand Down

0 comments on commit db7bb2d

Please sign in to comment.