Fix #6101: Rides remain in ride list briefly after demolition (#6165)

This commit is contained in:
Richard Jenkins 2017-08-12 13:00:43 +01:00 committed by Ted John
parent 68c2175cf3
commit 8e92351a2b
3 changed files with 11 additions and 2 deletions

View File

@ -715,6 +715,7 @@ rct_window *window_ride_open_vehicle(rct_vehicle *vehicle);
void window_ride_demolish_prompt_open(sint32 rideIndex);
void window_ride_construct(rct_window *w);
void window_ride_list_open();
void window_ride_list_refresh_list(rct_window *w);
rct_window *window_ride_construction_open();
rct_window *window_maze_construction_open();
void ride_construction_toolupdate_entrance_exit(sint32 screenX, sint32 screenY);

View File

@ -99,10 +99,19 @@ static void _window_ride_demolish_prompt_open(sint32 rideIndex)
*/
static void window_ride_demolish_mouseup(rct_window *w, rct_widgetindex widgetIndex)
{
rct_window* window;
switch (widgetIndex) {
case WIDX_DEMOLISH:
gGameCommandErrorTitle = STR_CANT_DEMOLISH_RIDE;
game_do_command(0, 1, 0, w->number, GAME_COMMAND_DEMOLISH_RIDE, 0, 1); // Set ebp to 1 to be used to log demolish from window prompt
// Prevents demolished rides sticking around in the ride list window
window = window_find_by_class(WC_RIDE_LIST);
if (window != NULL)
{
window_ride_list_refresh_list(window);
}
break;
case WIDX_CANCEL:
case WIDX_CLOSE:

View File

@ -188,7 +188,6 @@ static const rct_string_id page_names[] = {
static sint32 _window_ride_list_information_type;
static void window_ride_list_draw_tab_images(rct_drawpixelinfo *dpi, rct_window *w);
static void window_ride_list_refresh_list(rct_window *w);
static void window_ride_list_close_all(rct_window *w);
static void window_ride_list_open_all(rct_window *w);
@ -739,7 +738,7 @@ static void window_ride_list_draw_tab_images(rct_drawpixelinfo *dpi, rct_window
*
* rct2: 0x006B39A8
*/
static void window_ride_list_refresh_list(rct_window *w)
void window_ride_list_refresh_list(rct_window *w)
{
sint32 i;
rct_ride *ride, *otherRide;