diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 82b04228a8..d303f5a56f 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -6,6 +6,7 @@ - Feature: [#22414] Finance graphs can be resized. - Change: [#21659] Increase the Hybrid Roller Coaster’s maximum lift speed to 17 km/h (11 mph). - Change: [#22466] The Clear Scenery tool now uses a bulldozer cursor instead of a generic crosshair. +- Change: [#22490] In sandbox mode, changing land or construction rights now acts as buying or selling. - Change: [#22491] Scrollbars are now hidden if the scrollable widget is not actually overflowing. - Fix: [#21908] Errors showing up when placing/moving track design previews. - Fix: [#22307] Hover tooltips in financial charts are not invalidated properly. diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 08f9e2dc11..9fe1f09555 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -185,7 +185,32 @@ GameActions::Result LandSetRightsAction::MapBuyLandRightsForTile(const CoordsXY& } auto& gameState = GetGameState(); - res.Cost = gameState.LandPrice; + const uint8_t currentOwnership = surfaceElement->GetOwnership(); + + // Are land rights or construction rights currently owned? + if (!(currentOwnership & (OWNERSHIP_OWNED | OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED))) + { + // Buying land + if (!(currentOwnership & OWNERSHIP_OWNED) && (_ownership & OWNERSHIP_OWNED)) + res.Cost = gameState.LandPrice; + + // Buying construction rights + if (!(currentOwnership & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED) + && (_ownership & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED)) + res.Cost = gameState.ConstructionRightsPrice; + } + else + { + // Selling land + if ((currentOwnership & OWNERSHIP_OWNED) && !(_ownership & OWNERSHIP_OWNED)) + res.Cost = -gameState.LandPrice; + + // Selling construction rights + if ((currentOwnership & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED) + && !(_ownership & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED)) + res.Cost = -gameState.ConstructionRightsPrice; + } + if (isExecuting) { if (_ownership != OWNERSHIP_UNOWNED) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 7954508464..437f81cc26 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -49,7 +49,7 @@ using namespace OpenRCT2; // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -constexpr uint8_t kNetworkStreamVersion = 2; +constexpr uint8_t kNetworkStreamVersion = 3; const std::string kNetworkStreamID = std::string(OPENRCT2_VERSION) + "-" + std::to_string(kNetworkStreamVersion);