1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 14:02:59 +01:00

Fix #11695. Mechanics walking to 0,0 on entrance only (#11704)

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:
Duncan
2020-05-11 19:28:40 +01:00
committed by GitHub
parent 89011b105f
commit 79dda7260a
3 changed files with 21 additions and 1 deletions

View File

@@ -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;

View File

@@ -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 };
}
};