Close #9104: Calculate maze support costs

This commit is contained in:
Rik Smeets 2022-08-22 18:51:16 +02:00
parent 5c596eae5d
commit f7c769603b
4 changed files with 9 additions and 4 deletions

View file

@ -10,6 +10,7 @@
- Improved: [#15358] Park and scenario names can now contain up to 128 characters.
- Improved: [#16840] Add support for rectangular heightmaps.
- Improved: [#17575] You can now search for Authors in Object Selection.
- Change: [#9104] Calculate maze support costs.
- Change: [#17319] Giant screenshots are now cropped to the horizontal view-clipping selection.
- Change: [#17499] Update error text when using vehicle incompatible with TD6 and add error when using incompatible track elements.
- Change: [#17655] Lower default price for the Crooked House.

View file

@ -42,7 +42,7 @@
// This string specifies which version of network stream current build uses.
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "7"
#define NETWORK_STREAM_VERSION "8"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
static Peep* _pickup_peep = nullptr;

View file

@ -197,10 +197,14 @@ TRACK_PAINT_FUNCTION get_track_paint_function_maze(int32_t trackType)
return maze_paint_setup;
}
money64 MazeCalculateCost(money32 constructionCost, const Ride& ride)
money64 MazeCalculateCost(money32 constructionCost, const Ride& ride, const CoordsXYZ& _loc)
{
const auto& ted = GetTrackElementDescriptor(TrackElemType::Maze);
money64 price = (ride.GetRideTypeDescriptor().BuildCosts.TrackPrice * ted.PriceModifier) >> 16;
return constructionCost + price;
auto surfaceElement = map_get_surface_element_at(_loc);
auto heightDifference = (_loc.z - surfaceElement->GetBaseZ()) / COORDS_Z_PER_TINY_Z;
money64 supportCost = heightDifference * ride.GetRideTypeDescriptor().BuildCosts.SupportPrice;
return constructionCost + price + supportCost;
}

View file

@ -11,4 +11,4 @@
#include "../RideData.h"
money64 MazeCalculateCost(money32 constructionCost, const Ride& ride);
money64 MazeCalculateCost(money32 constructionCost, const Ride& ride, const CoordsXYZ& _loc);