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:
committed by
Michael Steenbeek
parent
97b1c888b3
commit
d486ac4d3b
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user