[Change] More work to improve accel sound handling when paused and
hyperspacing.
This commit is contained in:
parent
a70a55982e
commit
7c77674d1f
12
src/player.c
12
src/player.c
@ -2009,6 +2009,8 @@ void player_land(void) {
|
|||||||
}
|
}
|
||||||
/* Stop afterburning. */
|
/* Stop afterburning. */
|
||||||
player_afterburnOver();
|
player_afterburnOver();
|
||||||
|
/* Stop accelerating. */
|
||||||
|
player_accelOver();
|
||||||
|
|
||||||
/* Open land menu. */
|
/* Open land menu. */
|
||||||
player_soundPause();
|
player_soundPause();
|
||||||
@ -2164,6 +2166,9 @@ double player_faceHyperspace(void) {
|
|||||||
* @brief Activate the afterburner.
|
* @brief Activate the afterburner.
|
||||||
*/
|
*/
|
||||||
void player_afterburn(void) {
|
void player_afterburn(void) {
|
||||||
|
if(pilot_isFlag(player, PILOT_HYP_PREP) || pilot_isFlag(player, PILOT_HYPERSPACE))
|
||||||
|
return;
|
||||||
|
|
||||||
/* @todo Fancy effects. */
|
/* @todo Fancy effects. */
|
||||||
if((player != NULL) && (player->afterburner != NULL)) {
|
if((player != NULL) && (player->afterburner != NULL)) {
|
||||||
player_setFlag(PLAYER_AFTERBURNER);
|
player_setFlag(PLAYER_AFTERBURNER);
|
||||||
@ -2172,7 +2177,7 @@ void player_afterburn(void) {
|
|||||||
sound_stopGroup(PLAYER_ENGINE_CHANNEL);
|
sound_stopGroup(PLAYER_ENGINE_CHANNEL);
|
||||||
sound_playGroup(PLAYER_ENGINE_CHANNEL,
|
sound_playGroup(PLAYER_ENGINE_CHANNEL,
|
||||||
player->afterburner->outfit->u.afb.sound, 0);
|
player->afterburner->outfit->u.afb.sound, 0);
|
||||||
if(toolkit)
|
if(toolkit || paused)
|
||||||
player_soundPause();
|
player_soundPause();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2193,12 +2198,15 @@ void player_afterburnOver(void) {
|
|||||||
* @param acc How much thrust should be applied of maximum (0 - 1).
|
* @param acc How much thrust should be applied of maximum (0 - 1).
|
||||||
*/
|
*/
|
||||||
void player_accel(double acc) {
|
void player_accel(double acc) {
|
||||||
|
if(pilot_isFlag(player, PILOT_HYP_PREP) || pilot_isFlag(player, PILOT_HYPERSPACE))
|
||||||
|
return;
|
||||||
|
|
||||||
if(player != NULL) {
|
if(player != NULL) {
|
||||||
player_acc = acc;
|
player_acc = acc;
|
||||||
sound_stopGroup(PLAYER_ENGINE_CHANNEL);
|
sound_stopGroup(PLAYER_ENGINE_CHANNEL);
|
||||||
sound_playGroup(PLAYER_ENGINE_CHANNEL,
|
sound_playGroup(PLAYER_ENGINE_CHANNEL,
|
||||||
player->ship->sound, 0);
|
player->ship->sound, 0);
|
||||||
if(toolkit)
|
if(toolkit || paused)
|
||||||
player_soundPause();
|
player_soundPause();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user