Fix #5931: Money overflow when placing track design

This commit is contained in:
Michał Janiszewski 2017-08-01 07:34:23 +02:00
parent 12067cb558
commit 9e8a644fcc
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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) {