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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 1 deletions

View File

@ -27,6 +27,7 @@
- Fix: [#11455] Object Selection window cuts off scenery names.
- Fix: [#11640] Objects with a blank description in one language do not fall back to other languages anymore.
- Fix: [#11676] Spiral Roller Coaster has regular lift hill available.
- Fix: [#11695] Mechanics walk to tile 0, 0 at entrance only stations when trying to fix them.
- Fix: RCT1 scenarios have more items in the object list than are present in the park or the research list.
- Improved: [#6530] Allow water and land height changes on park borders.
- Improved: [#11390] Build hash written to screenshot metadata.

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