diff --git a/src/audio/audio.c b/src/audio/audio.c index 9459019066..8dc38f7744 100644 --- a/src/audio/audio.c +++ b/src/audio/audio.c @@ -1770,18 +1770,6 @@ void audio_init2(int device) if (!(RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) & 1 << 4)) { RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) |= 1 << 4; } - - // When all sound code is reversed this can be removed. - if (!gConfigSound.sound){ - toggle_all_sounds(); - } - - // When all sound code is reversed this can be removed. - if (!gConfigSound.ride_music){ - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_MUSIC, uint8) ^= 1; - if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_MUSIC, uint8) == 0) - stop_ride_music(); - } } /** diff --git a/src/ride/ride.c b/src/ride/ride.c index d6823183ee..01ea817317 100644 --- a/src/ride/ride.c +++ b/src/ride/ride.c @@ -3373,7 +3373,7 @@ void ride_music_update_final() int ebx; if (!(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 2)) { if ((RCT2_GLOBAL(0x009AF284, uint32) & (1 << 0))) { - if (!gGameSoundsOff && gConfigSound.sound && RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_MUSIC, uint8) && !(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 1)) { + if (!gGameSoundsOff && gConfigSound.sound && gConfigSound.ride_music && !(RCT2_GLOBAL(RCT2_ADDRESS_SCREEN_FLAGS, uint8) & 1)) { // set to stop music if volume <= 1 ? while (1) { int v8 = 0; diff --git a/src/windows/options.c b/src/windows/options.c index a13cd32401..3d0e982d70 100644 --- a/src/windows/options.c +++ b/src/windows/options.c @@ -488,11 +488,10 @@ static void window_options_mouseup(rct_window *w, int widgetIndex) window_invalidate(w); break; case WIDX_MUSIC_CHECKBOX: - RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_MUSIC, uint8) ^= 1; - if (RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_MUSIC, uint8) == 0) + gConfigSound.ride_music = !gConfigSound.ride_music; + if (!gConfigSound.ride_music) { stop_ride_music(); - - gConfigSound.ride_music ^= 1; + } config_save_default(); window_invalidate(w); break; @@ -1127,10 +1126,10 @@ static void window_options_invalidate(rct_window *w) } // music: on/off - RCT2_GLOBAL(0x013CE952 + 8, uint16) = STR_OFF + RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_MUSIC, uint8); + RCT2_GLOBAL(0x013CE952 + 8, uint16) = STR_OFF + gConfigSound.ride_music; widget_set_checkbox_value(w, WIDX_SOUND_CHECKBOX, gConfigSound.sound); - widget_set_checkbox_value(w, WIDX_MUSIC_CHECKBOX, RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_MUSIC, uint8)); + widget_set_checkbox_value(w, WIDX_MUSIC_CHECKBOX, gConfigSound.ride_music); if(w->frame_no == 0){ // initialize only on first frame, otherwise the scrollbars wont be able to be modified widget = &window_options_audio_widgets[WIDX_MASTER_VOLUME];