summaryrefslogtreecommitdiff
path: root/src/game/bg_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/bg_misc.c')
-rw-r--r--src/game/bg_misc.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/game/bg_misc.c b/src/game/bg_misc.c
index 54650521..3f30a127 100644
--- a/src/game/bg_misc.c
+++ b/src/game/bg_misc.c
@@ -5472,6 +5472,28 @@ weapon_t BG_GetPlayerWeapon( playerState_t *ps )
}
/*
+=================
+BG_HasEnergyWeapon
+
+Returns true if the player has an energy weapon.
+=================
+*/
+qboolean BG_HasEnergyWeapon( playerState_t *ps )
+{
+ int i;
+
+ for( i = WP_NONE + 1; i < WP_NUM_WEAPONS; i++ )
+ {
+ if( !BG_InventoryContainsWeapon( i, ps->stats ) ||
+ !BG_FindUsesEnergyForWeapon( i ) )
+ continue;
+
+ return qtrue;
+ }
+ return qfalse;
+}
+
+/*
===============
atof_neg