mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #10602: Error adding track scenery additions far from station start
Issue caused due to stuffing a temporary unsigned variable in a signed variable. This fix is not a permanent fix and this field in the future should be split up into two separate fields: tile position and relative tile position. Co-authored-by: Gymnasiast <m.o.steenbeek@gmail.com>
This commit is contained in:
parent
de6e6e9d8f
commit
3003e1de75
|
@ -528,7 +528,9 @@ rct_string_id TrackDesign::CreateTrackDesignScenery()
|
|||
}
|
||||
}
|
||||
|
||||
CoordsXY sceneryMapPos{ scenery.x * 32 - gTrackPreviewOrigin.x, scenery.y * 32 - gTrackPreviewOrigin.y };
|
||||
// Cast the value into a uint8_t as this value is not signed yet.
|
||||
auto sceneryPos = TileCoordsXY(static_cast<uint8_t>(scenery.x), static_cast<uint8_t>(scenery.y)).ToCoordsXY();
|
||||
CoordsXY sceneryMapPos = sceneryPos - gTrackPreviewOrigin;
|
||||
CoordsXY rotatedSceneryMapPos = sceneryMapPos.Rotate(0 - _saveDirection);
|
||||
TileCoordsXY sceneryTilePos{ rotatedSceneryMapPos };
|
||||
|
||||
|
|
Loading…
Reference in New Issue