mirror of https://github.com/OpenRCT2/OpenRCT2.git
Refactor map_can_build_at to use CoordsXYZ
This commit is contained in:
parent
5333dc4295
commit
0a1cb68328
|
@ -72,7 +72,7 @@ public:
|
|||
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_POSITION_THIS_HERE, STR_CAN_ONLY_BE_BUILT_ACROSS_PATHS);
|
||||
}
|
||||
|
||||
if (!map_can_build_at(_loc.x, _loc.y, _loc.z))
|
||||
if (!map_can_build_at({ _loc.x, _loc.y, _loc.z }))
|
||||
{
|
||||
return MakeResult(GA_ERROR::NOT_OWNED, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
res->Position.z = _loc.z;
|
||||
res->ErrorTitle = STR_CANT_REMOVE_THIS;
|
||||
|
||||
if (!map_can_build_at(_loc.x, _loc.y, _loc.z - 16))
|
||||
if (!map_can_build_at({ _loc.x, _loc.y, _loc.z - 16 }))
|
||||
{
|
||||
return MakeResult(GA_ERROR::NOT_OWNED, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ private:
|
|||
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_REPAINT_THIS);
|
||||
}
|
||||
|
||||
if (!map_can_build_at(_loc.x, _loc.y, _loc.z - 16))
|
||||
if (!map_can_build_at({ _loc.x, _loc.y, _loc.z - 16 }))
|
||||
{
|
||||
return MakeResult(GA_ERROR::NOT_OWNED, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK);
|
||||
}
|
||||
|
|
|
@ -742,13 +742,13 @@ bool map_is_edge(const CoordsXY coords)
|
|||
return (coords.x < 32 || coords.y < 32 || coords.x >= gMapSizeUnits || coords.y >= gMapSizeUnits);
|
||||
}
|
||||
|
||||
bool map_can_build_at(int32_t x, int32_t y, int32_t z)
|
||||
bool map_can_build_at(CoordsXYZ loc)
|
||||
{
|
||||
if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR)
|
||||
return true;
|
||||
if (gCheatsSandboxMode)
|
||||
return true;
|
||||
if (map_is_location_owned({ x, y, z }))
|
||||
if (map_is_location_owned(loc))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -161,7 +161,7 @@ void map_restore_provisional_elements();
|
|||
void map_update_path_wide_flags();
|
||||
bool map_is_location_valid(CoordsXY coords);
|
||||
bool map_is_edge(CoordsXY coords);
|
||||
bool map_can_build_at(int32_t x, int32_t y, int32_t z);
|
||||
bool map_can_build_at(CoordsXYZ loc);
|
||||
bool map_is_location_owned(CoordsXYZ loc);
|
||||
bool map_is_location_in_park(CoordsXY coords);
|
||||
bool map_is_location_owned_or_has_rights(int32_t x, int32_t y);
|
||||
|
|
Loading…
Reference in New Issue