mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #14751: Height limitation also affects trees
This commit is contained in:
parent
072772af7b
commit
1031be9078
|
@ -9,6 +9,7 @@
|
||||||
- Feature: [#14731] Opaque water (like in RCT1).
|
- Feature: [#14731] Opaque water (like in RCT1).
|
||||||
- Change: [#14496] [Plugin] Rename Object to LoadedObject to fix conflicts with Typescript's Object interface.
|
- Change: [#14496] [Plugin] Rename Object to LoadedObject to fix conflicts with Typescript's Object interface.
|
||||||
- Change: [#14536] [Plugin] Rename ListView to ListViewWidget to make it consistent with names of other widgets.
|
- Change: [#14536] [Plugin] Rename ListView to ListViewWidget to make it consistent with names of other widgets.
|
||||||
|
- Change: [#14751] “No construction above tree height” limitation now allows placing high trees.
|
||||||
- Fix: [#11829] Visual glitches and crashes when using RCT1 assets from mismatched or corrupt CSG1.DAT and CSG1i.DAT files.
|
- Fix: [#11829] Visual glitches and crashes when using RCT1 assets from mismatched or corrupt CSG1.DAT and CSG1i.DAT files.
|
||||||
- Fix: [#13581] Opening the Options menu causes a noticeable drop in FPS.
|
- Fix: [#13581] Opening the Options menu causes a noticeable drop in FPS.
|
||||||
- Fix: [#13894] Block brakes do not animate.
|
- Fix: [#13894] Block brakes do not animate.
|
||||||
|
|
|
@ -162,7 +162,7 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Query() const
|
||||||
QuarterTile quarterTile = QuarterTile{ static_cast<uint8_t>(tile->flags >> 12), 0 }.Rotate(_loc.direction);
|
QuarterTile quarterTile = QuarterTile{ static_cast<uint8_t>(tile->flags >> 12), 0 }.Rotate(_loc.direction);
|
||||||
if (!map_can_construct_with_clear_at(
|
if (!map_can_construct_with_clear_at(
|
||||||
{ curTile, zLow, zHigh }, &map_place_scenery_clear_func, quarterTile, GetFlags(), &supportsCost,
|
{ curTile, zLow, zHigh }, &map_place_scenery_clear_func, quarterTile, GetFlags(), &supportsCost,
|
||||||
CREATE_CROSSING_MODE_NONE))
|
CREATE_CROSSING_MODE_NONE, (sceneryEntry->flags & LARGE_SCENERY_FLAG_IS_TREE) != 0))
|
||||||
{
|
{
|
||||||
return std::make_unique<LargeSceneryPlaceActionResult>(
|
return std::make_unique<LargeSceneryPlaceActionResult>(
|
||||||
GameActions::Status::NoClearance, gGameCommandErrorText, gCommonFormatArgs);
|
GameActions::Status::NoClearance, gGameCommandErrorText, gCommonFormatArgs);
|
||||||
|
@ -260,7 +260,7 @@ GameActions::Result::Ptr LargeSceneryPlaceAction::Execute() const
|
||||||
QuarterTile quarterTile = QuarterTile{ static_cast<uint8_t>(tile->flags >> 12), 0 }.Rotate(_loc.direction);
|
QuarterTile quarterTile = QuarterTile{ static_cast<uint8_t>(tile->flags >> 12), 0 }.Rotate(_loc.direction);
|
||||||
if (!map_can_construct_with_clear_at(
|
if (!map_can_construct_with_clear_at(
|
||||||
{ curTile, zLow, zHigh }, &map_place_scenery_clear_func, quarterTile, GetFlags(), &supportsCost,
|
{ curTile, zLow, zHigh }, &map_place_scenery_clear_func, quarterTile, GetFlags(), &supportsCost,
|
||||||
CREATE_CROSSING_MODE_NONE))
|
CREATE_CROSSING_MODE_NONE, (sceneryEntry->flags & LARGE_SCENERY_FLAG_IS_TREE) != 0))
|
||||||
{
|
{
|
||||||
return std::make_unique<LargeSceneryPlaceActionResult>(
|
return std::make_unique<LargeSceneryPlaceActionResult>(
|
||||||
GameActions::Status::NoClearance, gGameCommandErrorText, gCommonFormatArgs);
|
GameActions::Status::NoClearance, gGameCommandErrorText, gCommonFormatArgs);
|
||||||
|
|
|
@ -280,7 +280,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Query() const
|
||||||
|
|
||||||
if (!map_can_construct_with_clear_at(
|
if (!map_can_construct_with_clear_at(
|
||||||
{ _loc, zLow, zHigh }, &map_place_scenery_clear_func, quarterTile, GetFlags(), &clearCost,
|
{ _loc, zLow, zHigh }, &map_place_scenery_clear_func, quarterTile, GetFlags(), &clearCost,
|
||||||
CREATE_CROSSING_MODE_NONE))
|
CREATE_CROSSING_MODE_NONE, scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_IS_TREE)))
|
||||||
{
|
{
|
||||||
return std::make_unique<SmallSceneryPlaceActionResult>(
|
return std::make_unique<SmallSceneryPlaceActionResult>(
|
||||||
GameActions::Status::Disallowed, gGameCommandErrorText, gCommonFormatArgs);
|
GameActions::Status::Disallowed, gGameCommandErrorText, gCommonFormatArgs);
|
||||||
|
@ -418,7 +418,7 @@ GameActions::Result::Ptr SmallSceneryPlaceAction::Execute() const
|
||||||
|
|
||||||
if (!map_can_construct_with_clear_at(
|
if (!map_can_construct_with_clear_at(
|
||||||
{ _loc, zLow, zHigh }, &map_place_scenery_clear_func, quarterTile, GetFlags() | GAME_COMMAND_FLAG_APPLY, &clearCost,
|
{ _loc, zLow, zHigh }, &map_place_scenery_clear_func, quarterTile, GetFlags() | GAME_COMMAND_FLAG_APPLY, &clearCost,
|
||||||
CREATE_CROSSING_MODE_NONE))
|
CREATE_CROSSING_MODE_NONE, scenery_small_entry_has_flag(sceneryEntry, SMALL_SCENERY_FLAG_IS_TREE)))
|
||||||
{
|
{
|
||||||
return std::make_unique<SmallSceneryPlaceActionResult>(
|
return std::make_unique<SmallSceneryPlaceActionResult>(
|
||||||
GameActions::Status::Disallowed, gGameCommandErrorText, gCommonFormatArgs);
|
GameActions::Status::Disallowed, gGameCommandErrorText, gCommonFormatArgs);
|
||||||
|
|
|
@ -144,6 +144,7 @@ void LargeSceneryObject::ReadJson(IReadObjectContext* context, json_t& root)
|
||||||
{ "hasSecondaryColour", LARGE_SCENERY_FLAG_HAS_SECONDARY_COLOUR },
|
{ "hasSecondaryColour", LARGE_SCENERY_FLAG_HAS_SECONDARY_COLOUR },
|
||||||
{ "isAnimated", LARGE_SCENERY_FLAG_ANIMATED },
|
{ "isAnimated", LARGE_SCENERY_FLAG_ANIMATED },
|
||||||
{ "isPhotogenic", LARGE_SCENERY_FLAG_PHOTOGENIC },
|
{ "isPhotogenic", LARGE_SCENERY_FLAG_PHOTOGENIC },
|
||||||
|
{ "isTree", LARGE_SCENERY_FLAG_IS_TREE },
|
||||||
});
|
});
|
||||||
|
|
||||||
// Tiles
|
// Tiles
|
||||||
|
|
|
@ -1298,7 +1298,7 @@ void map_obstruction_set_error_text(TileElement* tileElement, GameActions::Resul
|
||||||
* bl = bl
|
* bl = bl
|
||||||
*/
|
*/
|
||||||
std::unique_ptr<GameActions::ConstructClearResult> MapCanConstructWithClearAt(
|
std::unique_ptr<GameActions::ConstructClearResult> MapCanConstructWithClearAt(
|
||||||
const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, uint8_t crossingMode)
|
const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, uint8_t crossingMode, bool isTree)
|
||||||
{
|
{
|
||||||
int32_t northZ, eastZ, baseHeight, southZ, westZ, water_height;
|
int32_t northZ, eastZ, baseHeight, southZ, westZ, water_height;
|
||||||
northZ = eastZ = baseHeight = southZ = westZ = water_height = 0;
|
northZ = eastZ = baseHeight = southZ = westZ = water_height = 0;
|
||||||
|
@ -1350,7 +1350,7 @@ std::unique_ptr<GameActions::ConstructClearResult> MapCanConstructWithClearAt(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
loc_68B9B7:
|
loc_68B9B7:
|
||||||
if (gParkFlags & PARK_FLAGS_FORBID_HIGH_CONSTRUCTION)
|
if (gParkFlags & PARK_FLAGS_FORBID_HIGH_CONSTRUCTION && !isTree)
|
||||||
{
|
{
|
||||||
auto heightFromGround = pos.clearanceZ - tileElement->GetBaseZ();
|
auto heightFromGround = pos.clearanceZ - tileElement->GetBaseZ();
|
||||||
|
|
||||||
|
@ -1477,9 +1477,9 @@ std::unique_ptr<GameActions::ConstructClearResult> MapCanConstructWithClearAt(
|
||||||
|
|
||||||
bool map_can_construct_with_clear_at(
|
bool map_can_construct_with_clear_at(
|
||||||
const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, money32* price,
|
const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, money32* price,
|
||||||
uint8_t crossingMode)
|
uint8_t crossingMode, bool isTree)
|
||||||
{
|
{
|
||||||
auto res = MapCanConstructWithClearAt(pos, clearFunc, quarterTile, flags, crossingMode);
|
auto res = MapCanConstructWithClearAt(pos, clearFunc, quarterTile, flags, crossingMode, isTree);
|
||||||
if (auto message = res->ErrorMessage.AsStringId())
|
if (auto message = res->ErrorMessage.AsStringId())
|
||||||
gGameCommandErrorText = *message;
|
gGameCommandErrorText = *message;
|
||||||
else
|
else
|
||||||
|
|
|
@ -237,9 +237,10 @@ int32_t map_place_non_scenery_clear_func(TileElement** tile_element, const Coord
|
||||||
int32_t map_place_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price);
|
int32_t map_place_scenery_clear_func(TileElement** tile_element, const CoordsXY& coords, uint8_t flags, money32* price);
|
||||||
bool map_can_construct_with_clear_at(
|
bool map_can_construct_with_clear_at(
|
||||||
const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, money32* price,
|
const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, money32* price,
|
||||||
uint8_t crossingMode);
|
uint8_t crossingMode, bool isTree = false);
|
||||||
std::unique_ptr<GameActions::ConstructClearResult> MapCanConstructWithClearAt(
|
std::unique_ptr<GameActions::ConstructClearResult> MapCanConstructWithClearAt(
|
||||||
const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, uint8_t crossingMode);
|
const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, QuarterTile quarterTile, uint8_t flags, uint8_t crossingMode,
|
||||||
|
bool isTree = false);
|
||||||
std::unique_ptr<GameActions::ConstructClearResult> MapCanConstructAt(const CoordsXYRangedZ& pos, QuarterTile bl);
|
std::unique_ptr<GameActions::ConstructClearResult> MapCanConstructAt(const CoordsXYRangedZ& pos, QuarterTile bl);
|
||||||
int32_t map_can_construct_at(const CoordsXYRangedZ& pos, QuarterTile bl);
|
int32_t map_can_construct_at(const CoordsXYRangedZ& pos, QuarterTile bl);
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,7 @@ enum LARGE_SCENERY_FLAGS
|
||||||
LARGE_SCENERY_FLAG_3D_TEXT = (1 << 2), // 0x4
|
LARGE_SCENERY_FLAG_3D_TEXT = (1 << 2), // 0x4
|
||||||
LARGE_SCENERY_FLAG_ANIMATED = (1 << 3), // 0x8
|
LARGE_SCENERY_FLAG_ANIMATED = (1 << 3), // 0x8
|
||||||
LARGE_SCENERY_FLAG_PHOTOGENIC = (1 << 4), // 0x10
|
LARGE_SCENERY_FLAG_PHOTOGENIC = (1 << 4), // 0x10
|
||||||
|
LARGE_SCENERY_FLAG_IS_TREE = (1 << 5), // 0x20
|
||||||
};
|
};
|
||||||
|
|
||||||
enum WALL_SCENERY_FLAGS
|
enum WALL_SCENERY_FLAGS
|
||||||
|
|
Loading…
Reference in New Issue