summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/bg_pmove.c83
1 files changed, 30 insertions, 53 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c
index 50791ad4..b5bae3cc 100644
--- a/src/game/bg_pmove.c
+++ b/src/game/bg_pmove.c
@@ -2158,31 +2158,6 @@ static void PM_Weapon( void ) {
return;
}
- // check for item using
- //TA: not using q3 holdable item code
- /*if ( pm->cmd.buttons & BUTTON_USE_HOLDABLE )
- {
- if ( ! ( pm->ps->pm_flags & PMF_USE_ITEM_HELD ) )
- {
- if ( bg_itemlist[pm->ps->stats[STAT_HOLDABLE_ITEM]].giTag == HI_MEDKIT
- && pm->ps->stats[STAT_HEALTH] >= pm->ps->stats[STAT_MAX_HEALTH] )
- {
- // don't use medkit if at max health
- }
- else
- {
- pm->ps->pm_flags |= PMF_USE_ITEM_HELD;
- PM_AddEvent( EV_USE_ITEM0 + bg_itemlist[pm->ps->stats[STAT_HOLDABLE_ITEM]].giTag );
- pm->ps->stats[STAT_HOLDABLE_ITEM] = 0;
- }
- return;
- }
- }
- else
- {
- pm->ps->pm_flags &= ~PMF_USE_ITEM_HELD;
- }*/
-
// make weapon function
if ( pm->ps->weaponTime > 0 ) {
pm->ps->weaponTime -= pml.msec;
@@ -2248,30 +2223,6 @@ static void PM_Weapon( void ) {
// start the animation even if out of ammo
- switch( pm->ps->weapon )
- {
- case WP_VENOM:
- if( !pm->autoWeaponHit[ WP_VENOM ] )
- {
- pm->ps->weaponTime = 0;
- pm->ps->weaponstate = WEAPON_READY;
- return;
- }
- break;
-
- default:
- // check for fire
- if ( !( pm->cmd.buttons & BUTTON_ATTACK ) )
- {
- pm->ps->weaponTime = 0;
- pm->ps->weaponstate = WEAPON_READY;
- return;
- }
- break;
- }
-
- PM_StartTorsoAnim( TORSO_ATTACK );
-
BG_unpackAmmoArray( pm->ps->weapon, pm->ps->ammo, pm->ps->powerups, &ammo, &clips, &maxclips );
// check for out of ammo
@@ -2287,12 +2238,13 @@ static void PM_Weapon( void ) {
switch( pm->ps->weapon )
{
- default:
case WP_MACHINEGUN:
clips--;
ammo = CS_MG;
- break;
+ break;
+ default:
+ break;
}
BG_packAmmoArray( pm->ps->weapon, pm->ps->ammo, pm->ps->powerups, ammo, clips, maxclips );
@@ -2305,17 +2257,42 @@ static void PM_Weapon( void ) {
switch( pm->ps->weapon )
{
- default:
case WP_MACHINEGUN:
addTime = 2000;
- break;
+ break;
+ default:
+ break;
}
pm->ps->weaponTime += addTime;
return;
}
+ switch( pm->ps->weapon )
+ {
+ case WP_VENOM:
+ if( !pm->autoWeaponHit[ WP_VENOM ] )
+ {
+ pm->ps->weaponTime = 0;
+ pm->ps->weaponstate = WEAPON_READY;
+ return;
+ }
+ break;
+
+ default:
+ // check for fire
+ if ( !( pm->cmd.buttons & BUTTON_ATTACK ) )
+ {
+ pm->ps->weaponTime = 0;
+ pm->ps->weaponstate = WEAPON_READY;
+ return;
+ }
+ break;
+ }
+
+ PM_StartTorsoAnim( TORSO_ATTACK );
+
pm->ps->weaponstate = WEAPON_FIRING;
// take an ammo away if not infinite