Use helper function

This commit is contained in:
duncanspumpkin 2019-11-14 21:12:17 +00:00
parent 421107436f
commit 3b8bf56b71

View file

@ -1817,7 +1817,7 @@ CoordsXY screen_get_map_xy_with_z(ScreenCoordsXY screenCoords, int16_t z)
auto vpCoords = screen_coord_to_viewport_coord(viewport, screenCoords);
auto mapPosition = viewport_coord_to_map_coord(vpCoords.x, vpCoords.y, z);
if (mapPosition.x < 0 || mapPosition.x >= (256 * 32) || mapPosition.y < 0 || mapPosition.y > (256 * 32))
if (!map_is_location_valid(mapPosition))
{
return ret;
}