mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
Fix #5931: Money overflow when placing track design
This commit is contained in:
@@ -895,7 +895,7 @@ static sint32 track_design_place_scenery(rct_td6_scenery_element *scenery_start,
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
_trackDesignPlaceCost += cost;
|
||||
add_clamp_money32(_trackDesignPlaceCost, cost);
|
||||
if (_trackDesignPlaceOperation != PTD_OPERATION_2) {
|
||||
if (cost == MONEY32_UNDEFINED){
|
||||
_trackDesignPlaceCost = MONEY32_UNDEFINED;
|
||||
@@ -1131,7 +1131,7 @@ static bool track_design_place_ride(rct_track_td6 *td6, sint16 x, sint16 y, sint
|
||||
sint16 tempZ = z - trackCoordinates->z_begin;
|
||||
uint32 edi =
|
||||
((track->flags & 0x0F) << 17) |
|
||||
((track->flags & 0x0F) << 28) |
|
||||
((uint32)(track->flags & 0x0F) << 28) |
|
||||
(((track->flags >> 4) & 0x03) << 24) |
|
||||
(tempZ & 0xFFFF);
|
||||
|
||||
|
||||
@@ -488,8 +488,8 @@ static void window_track_place_draw_mini_preview(rct_track_td6 *td6)
|
||||
for (sint32 pass = 0; pass < 2; pass++) {
|
||||
rct_xy16 origin = { 0, 0 };
|
||||
if (pass == 1) {
|
||||
origin.x -= ((max.x + min.x) >> 6) << 5;
|
||||
origin.y -= ((max.y + min.y) >> 6) << 5;
|
||||
origin.x -= ((max.x + min.x) >> 6) * 32;
|
||||
origin.y -= ((max.y + min.y) >> 6) * 32;
|
||||
}
|
||||
|
||||
if (td6->type == RIDE_TYPE_MAZE) {
|
||||
|
||||
Reference in New Issue
Block a user