1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Fix #1013: negative length in Ride window (#11651)

This commit is contained in:
Michael Steenbeek
2020-05-06 11:32:10 +02:00
committed by GitHub
parent 5271e06abf
commit 8660bbe9d7
4 changed files with 9 additions and 8 deletions

View File

@@ -1940,8 +1940,8 @@ STR_2728 :{UINT16}hour:{UINT16}min
STR_2729 :{UINT16}hour:{UINT16}mins
STR_2730 :{UINT16}hours:{UINT16}min
STR_2731 :{UINT16}hours:{UINT16}mins
STR_2732 :{COMMA16}ft
STR_2733 :{COMMA16}m
STR_2732 :{COMMA32}ft
STR_2733 :{COMMA32}m
STR_2734 :{COMMA16}mph
STR_2735 :{COMMA16}km/h
STR_2736 :{MONTH}, Year {COMMA16}

View File

@@ -1,5 +1,6 @@
0.2.6+ (in development)
------------------------------------------------------------------------
- Feature: [#7648] "Enable all drawable track pieces" now enables more pieces for the Twister, Vertical and Air Powered Vertical coasters.
- Feature: [#9029] Open doors with the tile inspector.
- Feature: [#10572] Cheat to allow building at invalid heights.
- Feature: [#11231] Change shortcut window list order to be more intuitive, and split it into logical sections.
@@ -8,6 +9,7 @@
- Change: [#11209] Warn when user is running OpenRCT2 through Wine.
- Change: [#11358] Switch copy and paste button positions in tile inspector.
- Change: [#11449] Remove complete circuit requirement from Air Powered Vertical Coaster (for RCT1 parity).
- Fix: [#1013] Negative length displayed in Ride window.
- Fix: [#1148] Research funding dropdown not shown in finances window.
- Fix: [#5451] Guests scream on every descent, no matter how small.
- Fix: [#6119] Advertising campaign for ride window not updated properly (original bug).

View File

@@ -5831,7 +5831,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi
int32_t numLengths = 0;
for (int32_t i = 0; i < ride->num_stations; i++)
{
length = ride->stations[numLengths].SegmentLength;
length = ride->stations[i].SegmentLength;
if (length != 0)
{
length >>= 16;

View File

@@ -882,7 +882,7 @@ static void format_date(char** dest, size_t* size, uint16_t value)
format_string_part(dest, size, STR_DATE_FORMAT_MY, reinterpret_cast<char**>(&argsRef));
}
static void format_length(char** dest, size_t* size, int16_t value)
static void format_length(char** dest, size_t* size, int32_t value)
{
rct_string_id stringId = STR_UNIT_SUFFIX_METRES;
@@ -892,7 +892,7 @@ static void format_length(char** dest, size_t* size, int16_t value)
stringId = STR_UNIT_SUFFIX_FEET;
}
int16_t* argRef = &value;
int32_t* argRef = &value;
format_string_part(dest, size, stringId, reinterpret_cast<char**>(&argRef));
}
@@ -1135,11 +1135,10 @@ static void format_string_code(uint32_t format_code, char** dest, size_t* size,
break;
case FORMAT_LENGTH:
// Pop argument
std::memcpy(&temp16, *args, sizeof(int16_t));
value = temp16;
std::memcpy(&value, *args, sizeof(uint16_t));
*args += 2;
format_length(dest, size, static_cast<int16_t>(value));
format_length(dest, size, static_cast<uint16_t>(value));
break;
case FORMAT_SPRITE:
// Pop argument