1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 09:44:52 +01:00

Reduce direct usage of LOCATION_NULL (#10480)

* Reduce direct usage of Location_Null

Ideally we want to refactor these out to use std::optional as much as possible but for now move to using the standard interfaces.

* Remove incorrect AND with LOCATION_NULL

In the original this was a simple comparison to check for negative. Unsure how it ended up as an AND with the negative bit.
This commit is contained in:
Duncan
2019-12-31 08:01:17 +00:00
committed by Michael Steenbeek
parent 97b1c888b3
commit d486ac4d3b
11 changed files with 21 additions and 21 deletions

View File

@@ -110,7 +110,7 @@ std::optional<ScreenCoordsXY> centre_2d_coordinates(CoordsXYZ loc, rct_viewport*
// If the start location was invalid
// propagate the invalid location to the output.
// This fixes a bug that caused the game to enter an infinite loop.
if (loc.x == LOCATION_NULL)
if (loc.isNull())
{
return std::nullopt;
}