widget_index is sint16, make sure the check is valid (#3335)

This commit is contained in:
janisozaur 2016-04-20 19:08:05 +02:00 committed by Ted John
parent 0286efc546
commit e9bf2a742f
1 changed files with 1 additions and 1 deletions

View File

@ -1803,7 +1803,7 @@ void tool_cancel()
// Reset map selection
RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) = 0;
if (gCurrentToolWidget.widget_index != 0xFFFF) {
if (gCurrentToolWidget.widget_index != -1) {
// Invalidate tool widget
widget_invalidate_by_number(
gCurrentToolWidget.window_classification,