mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-21 05:53:02 +01:00
Fix wall placement in track designs.
X and Y values go a bit screwey in ride previews. So you need to override there check. Also fixed the wall from nesting the command wrong
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "../ride/RideGroupManager.h"
|
||||
#include "../ride/Track.h"
|
||||
#include "../ride/TrackData.h"
|
||||
#include "../ride/TrackDesign.h"
|
||||
#include "../world/Banner.h"
|
||||
#include "../world/LargeScenery.h"
|
||||
#include "../world/MapAnimation.h"
|
||||
@@ -71,7 +72,7 @@ public:
|
||||
res->Position.x += 16;
|
||||
res->Position.y += 16;
|
||||
|
||||
if (res->Position.z == 0)
|
||||
if (_loc.z == 0)
|
||||
{
|
||||
res->Position.z = tile_element_height(res->Position.x, res->Position.y) & 0xFFFF;
|
||||
}
|
||||
@@ -91,7 +92,7 @@ public:
|
||||
return MakeResult(GA_ERROR::NOT_OWNED, STR_CANT_BUILD_PARK_ENTRANCE_HERE);
|
||||
}
|
||||
}
|
||||
else if ((_loc.x > gMapSizeMaxXY || _loc.y > gMapSizeMaxXY))
|
||||
else if (!byte_9D8150 && (_loc.x > gMapSizeMaxXY || _loc.y > gMapSizeMaxXY))
|
||||
{
|
||||
log_error("Invalid x/y coordinates. x = %d y = %d", _loc.x, _loc.y);
|
||||
return MakeResult(GA_ERROR::INVALID_PARAMETERS, STR_CANT_BUILD_PARK_ENTRANCE_HERE);
|
||||
|
||||
@@ -961,8 +961,8 @@ static bool TrackDesignPlaceSceneryElement(
|
||||
entry_index, { mapCoord.x, mapCoord.y, z }, rotation, scenery->primary_colour, scenery->secondary_colour,
|
||||
scenery->flags & 0xFC);
|
||||
wallPlaceAction.SetFlags(flags);
|
||||
auto res = flags & GAME_COMMAND_FLAG_APPLY ? GameActions::Execute(&wallPlaceAction)
|
||||
: GameActions::Query(&wallPlaceAction);
|
||||
auto res = flags & GAME_COMMAND_FLAG_APPLY ? GameActions::ExecuteNested(&wallPlaceAction)
|
||||
: GameActions::QueryNested(&wallPlaceAction);
|
||||
|
||||
cost = res->Cost;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user