diff --git a/src/interface/window.c b/src/interface/window.c index 33071eae03..0ba2ba70d3 100644 --- a/src/interface/window.c +++ b/src/interface/window.c @@ -1778,7 +1778,7 @@ void tool_cancel() // Reset map selection RCT2_GLOBAL(RCT2_ADDRESS_MAP_SELECTION_FLAGS, uint16) = 0; - if (RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WIDGETINDEX, uint16) >= 0) { + if (RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WIDGETINDEX, uint16) != 0xFFFF) { // Invalidate tool widget widget_invalidate_by_number( RCT2_GLOBAL(RCT2_ADDRESS_TOOL_WINDOWCLASS, rct_windowclass), diff --git a/src/windows/map.c b/src/windows/map.c index 2c5ea253d5..8e6b06b766 100644 --- a/src/windows/map.c +++ b/src/windows/map.c @@ -1547,11 +1547,10 @@ static uint16 map_window_get_pixel_colour_peep(int x, int y) if (!(mapElement->properties.surface.ownership & OWNERSHIP_OWNED)) colour = 10 | (colour & 0xFF00); - const size_t count = countof(ElementTypeAddColour); + const int maxSupportedMapElementType = (int)countof(ElementTypeAddColour); while (!map_element_is_last_for_tile(mapElement++)) { int mapElementType = map_element_get_type(mapElement) >> 2; - if (mapElementType >= count) - { + if (mapElementType >= maxSupportedMapElementType) { mapElementType = MAP_ELEMENT_TYPE_CORRUPT >> 2; } colour &= ElementTypeMaskColour[mapElementType];