mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
fix #3294: crash when closing a window being dragged
This commit is contained in:
@@ -535,7 +535,13 @@ static void input_viewport_drag_continue()
|
||||
dx = newDragX - gInputDragLastX;
|
||||
dy = newDragY - gInputDragLastY;
|
||||
w = window_find_by_number(_dragWidget.window_classification, _dragWidget.window_number);
|
||||
assert(w != NULL);
|
||||
|
||||
// #3294: Window can be closed during a drag session, so just finish
|
||||
// the session if the window no longer exists
|
||||
if (w == NULL) {
|
||||
input_viewport_drag_end();
|
||||
return;
|
||||
}
|
||||
|
||||
viewport = w->viewport;
|
||||
_ticksSinceDragStart += RCT2_GLOBAL(RCT2_ADDRESS_TICKS_SINCE_LAST_UPDATE, sint16);
|
||||
|
||||
Reference in New Issue
Block a user