diff options
Diffstat (limited to 'src/game/bg_pmove.c')
-rw-r--r-- | src/game/bg_pmove.c | 56 |
1 files changed, 37 insertions, 19 deletions
diff --git a/src/game/bg_pmove.c b/src/game/bg_pmove.c index 9fad4f4..62151f4 100644 --- a/src/game/bg_pmove.c +++ b/src/game/bg_pmove.c @@ -507,9 +507,11 @@ static float PM_CmdScale( usercmd_t *cmd ) if( BG_Class( pm->ps->stats[ STAT_CLASS ] )->jumpMagnitude == 0.0f ) cmd->upmove = 0; + /* Commented out as the following seems to cause swimming up/down issues for aliens //prevent speed distortions for non ducking classes if( !( pm->ps->pm_flags & PMF_DUCKED ) && pm->ps->pm_type != PM_JETPACK && cmd->upmove < 0 ) cmd->upmove = 0; + */ } max = abs( cmd->forwardmove ); @@ -1204,7 +1206,6 @@ static void PM_WaterMove( void ) return; } -#if 0 // jump = head for surface if ( pm->cmd.upmove >= 10 ) { if (pm->ps->velocity[2] > -300) { @@ -1217,7 +1218,6 @@ static void PM_WaterMove( void ) } } } -#endif PM_Friction( ); @@ -3064,6 +3064,7 @@ static void PM_Weapon( void ) qboolean attack1 = pm->cmd.buttons & BUTTON_ATTACK; qboolean attack2 = pm->cmd.buttons & BUTTON_ATTACK2; qboolean attack3 = pm->cmd.buttons & BUTTON_USE_HOLDABLE; + int minAmmo; // Ignore weapons in some cases if( pm->ps->persistant[ PERS_SPECSTATE ] != SPECTATOR_NOT ) @@ -3323,8 +3324,12 @@ static void PM_Weapon( void ) return; } + if ( pm->ps->weapon == WP_LAS_GUN && attack2 ) + minAmmo = 20; + else minAmmo = 1; + // check for out of ammo - if( !pm->ps->ammo && !pm->ps->clips && !BG_Weapon( pm->ps->weapon )->infiniteAmmo ) + if( pm->ps->ammo < minAmmo && !pm->ps->clips && !BG_Weapon( pm->ps->weapon )->infiniteAmmo ) { if( attack1 || ( BG_Weapon( pm->ps->weapon )->hasAltMode && attack2 ) || ( BG_Weapon( pm->ps->weapon )->hasThirdMode && attack3 ) ) { @@ -3723,22 +3728,35 @@ static void PM_Weapon( void ) ( pm->ps->weapon == WP_ALEVEL4 && attack3 )|| ( pm->ps->weapon == WP_ALEVEL5 && attack3 )) { - // Special case for md third mode, need a bat for function (6+1) - if( (pm->ps->weapon == WP_MASS_DRIVER) && attack3 ) - pm->ps->ammo -= 7; - //prevent removing ammo from player if plasma isnt working yet but still eats all ammo if player has ammo >6 and no s3 - if( (pm->ps->weapon == WP_MASS_DRIVER) && attack3 && pm->ps->ammo < 7 ) - pm->ps->ammo += 1; - // Special case for lcannon - if( (pm->ps->weapon == WP_LUCIFER_CANNON) && attack1 && !attack2 ) - pm->ps->ammo -= ( pm->ps->stats[ STAT_MISC ] * LCANNON_CHARGE_AMMO + - LCANNON_CHARGE_TIME_MAX - 1 ) / LCANNON_CHARGE_TIME_MAX; - - if( (pm->ps->weapon == WP_FLAMER) && attack1 && !attack2 ) - pm->ps->ammo -= ( pm->ps->stats[ STAT_MISC ] * FLAMER_CHARGE_AMMO + - FLAMER_CHARGE_TIME_MAX - 1 ) / FLAMER_CHARGE_TIME_MAX; - else - pm->ps->ammo--; + switch( pm->ps->weapon ) { + case WP_MASS_DRIVER: + if( attack3 ) { + pm->ps->ammo -= 7; + if( pm->ps->ammo < 7 ) pm->ps->ammo += 1; + } else pm->ps->ammo--; + break; + case WP_LUCIFER_CANNON: + if( attack1 && !attack2 ) { + pm->ps->ammo -= ( pm->ps->stats[ STAT_MISC ] * LCANNON_CHARGE_AMMO + + LCANNON_CHARGE_TIME_MAX - 1 ) / LCANNON_CHARGE_TIME_MAX; + } else pm->ps->ammo--; + break; + case WP_FLAMER: + if( attack1 && !attack2 ) { + pm->ps->ammo -= ( pm->ps->stats[ STAT_MISC ] * FLAMER_CHARGE_AMMO + + FLAMER_CHARGE_TIME_MAX - 1 ) / FLAMER_CHARGE_TIME_MAX; + } else pm->ps->ammo--; + break; + case WP_LAS_GUN: + if( attack2 ) { + pm->ps->ammo -= 25; + } else pm->ps->ammo--; + break; + default: + pm->ps->ammo--; + break; + } + // Stay on the safe side if( pm->ps->ammo < 0 ) pm->ps->ammo = 0; |