mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-21 14:02:59 +01:00
Mistake made when refactoring that meant that null locations were converted into tile 0, 0. I've fixed the general case but it is preferred to try avoid using null states for coordinates if at all possible.
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
// This string specifies which version of network stream current build uses.
|
||||
// It is used for making sure only compatible builds get connected, even within
|
||||
// single OpenRCT2 version.
|
||||
#define NETWORK_STREAM_VERSION "14"
|
||||
#define NETWORK_STREAM_VERSION "15"
|
||||
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
|
||||
|
||||
static Peep* _pickup_peep = nullptr;
|
||||
|
||||
@@ -277,6 +277,13 @@ struct TileCoordsXY
|
||||
|
||||
CoordsXY ToCoordsXY() const
|
||||
{
|
||||
if (isNull())
|
||||
{
|
||||
CoordsXY ret{};
|
||||
ret.setNull();
|
||||
return ret;
|
||||
}
|
||||
|
||||
return { x * COORDS_XY_STEP, y * COORDS_XY_STEP };
|
||||
}
|
||||
|
||||
@@ -427,6 +434,12 @@ struct TileCoordsXYZ : public TileCoordsXY
|
||||
|
||||
CoordsXYZ ToCoordsXYZ() const
|
||||
{
|
||||
if (isNull())
|
||||
{
|
||||
CoordsXYZ ret{};
|
||||
ret.setNull();
|
||||
return ret;
|
||||
}
|
||||
return { x * COORDS_XY_STEP, y * COORDS_XY_STEP, z * COORDS_Z_STEP };
|
||||
}
|
||||
};
|
||||
@@ -585,6 +598,12 @@ struct TileCoordsXYZD : public TileCoordsXYZ
|
||||
|
||||
CoordsXYZD ToCoordsXYZD() const
|
||||
{
|
||||
if (isNull())
|
||||
{
|
||||
CoordsXYZD ret{};
|
||||
ret.setNull();
|
||||
return ret;
|
||||
}
|
||||
return { x * COORDS_XY_STEP, y * COORDS_XY_STEP, z * COORDS_Z_STEP, direction };
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user