Skip to content

Commit

Permalink
Fix OpenRCT2#23221: Track designs are saved with an incorrect ‘air’ t…
Browse files Browse the repository at this point in the history
…ime statistic
  • Loading branch information
Gymnasiast committed Jan 24, 2025
1 parent e3929c1 commit 85c0f0f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions distribution/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Change: [#23328] All RCT2 entertainer costumes are now available in legacy parks.
- Fix: [#1479] Incorrect values provided by the in game console “get location” command.
- Fix: [#21794] Lay-down coaster cars reverse on first frames of downwards corkscrew.
- Fix: [#23221] Track designs are saved with an incorrect ‘air’ time statistic.
- Fix: [#23368] Incorrect refund amount when deleting track pieces at or above 96m.
- Fix: [#23508] Simultaneous virtual floors shown for ride and footpath.
- Fix: [#23512] Holding brakes are skipped if they’re too close together.
Expand Down
3 changes: 2 additions & 1 deletion src/openrct2/rct2/T6Exporter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ namespace OpenRCT2::RCT2
tempStream.WriteValue<uint8_t>(0);
auto entranceStyle = GetStationStyleFromIdentifier(_trackDesign.appearance.stationObjectIdentifier);
tempStream.WriteValue<uint8_t>(entranceStyle);
uint16_t _totalAirTime = std::max<uint16_t>(255, (_trackDesign.statistics.totalAirTime * 123) / 1024);
// The 512 added is to enforce correctly rounding up, as integer division will truncate.
uint16_t _totalAirTime = std::min<uint16_t>(255, ((_trackDesign.statistics.totalAirTime * 123) + 512) / 1024);
tempStream.WriteValue<uint8_t>(_totalAirTime);
tempStream.WriteValue<uint8_t>(_trackDesign.operation.departFlags);
tempStream.WriteValue<uint8_t>(_trackDesign.trackAndVehicle.numberOfTrains);
Expand Down

0 comments on commit 85c0f0f

Please sign in to comment.