[Change] More work to improve accel sound handling when paused and

hyperspacing.
This commit is contained in:
Allanis 2014-05-22 18:51:27 +01:00
parent a70a55982e
commit 7c77674d1f

View File

@ -2009,6 +2009,8 @@ void player_land(void) {
}
/* Stop afterburning. */
player_afterburnOver();
/* Stop accelerating. */
player_accelOver();
/* Open land menu. */
player_soundPause();
@ -2164,6 +2166,9 @@ double player_faceHyperspace(void) {
* @brief Activate the afterburner.
*/
void player_afterburn(void) {
if(pilot_isFlag(player, PILOT_HYP_PREP) || pilot_isFlag(player, PILOT_HYPERSPACE))
return;
/* @todo Fancy effects. */
if((player != NULL) && (player->afterburner != NULL)) {
player_setFlag(PLAYER_AFTERBURNER);
@ -2172,7 +2177,7 @@ void player_afterburn(void) {
sound_stopGroup(PLAYER_ENGINE_CHANNEL);
sound_playGroup(PLAYER_ENGINE_CHANNEL,
player->afterburner->outfit->u.afb.sound, 0);
if(toolkit)
if(toolkit || paused)
player_soundPause();
}
}
@ -2193,12 +2198,15 @@ void player_afterburnOver(void) {
* @param acc How much thrust should be applied of maximum (0 - 1).
*/
void player_accel(double acc) {
if(pilot_isFlag(player, PILOT_HYP_PREP) || pilot_isFlag(player, PILOT_HYPERSPACE))
return;
if(player != NULL) {
player_acc = acc;
sound_stopGroup(PLAYER_ENGINE_CHANNEL);
sound_playGroup(PLAYER_ENGINE_CHANNEL,
player->ship->sound, 0);
if(toolkit)
if(toolkit || paused)
player_soundPause();
}
}