1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 06:44:38 +01:00

Merge pull request #9063 from duncanspumpkin/fix_wall

Fix wall
This commit is contained in:
Duncan
2019-04-06 19:19:53 +01:00
committed by GitHub
3 changed files with 7 additions and 6 deletions

View File

@@ -2515,7 +2515,7 @@ static money32 try_place_ghost_scenery(
auto wallPlaceAction = WallPlaceAction(
type, { map_tile.x, map_tile.y, gSceneryPlaceZ }, edges, primaryColour, _secondaryColour, _tertiaryColour);
wallPlaceAction.SetFlags(
GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_PATH_SCENERY);
GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND);
wallPlaceAction.SetCallback([=](const GameAction* ga, const GameActionResult* result) {
if (result->Error != GA_ERROR::OK)
return;

View File

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

View File

@@ -959,10 +959,10 @@ static bool TrackDesignPlaceSceneryElement(
auto wallPlaceAction = WallPlaceAction(
entry_index, { mapCoord.x, mapCoord.y, z }, rotation, scenery->primary_colour, scenery->secondary_colour,
scenery->flags & 0xFC);
(scenery->flags & 0xFC) >> 2);
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;