mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix #15138: Sometimes small scenery stays when building through it
This commit is contained in:
parent
072597f080
commit
8a1bd1f7d4
|
@ -2,6 +2,7 @@
|
|||
------------------------------------------------------------------------
|
||||
- Improved: [#12869] The Tile Inspector window’s layout has been tweaked slightly.
|
||||
- Change: [#15899] Weird bonus for path 0 - likely intended as a queue bonus (original bug).
|
||||
- Fix: [#15138] Sometimes small scenery stays when building through it.
|
||||
- Fix: [#15620] Placing track designs at locations blocked by anything results in wrong error message.
|
||||
- Fix: [#15843] Tile Inspector can be resized too small.
|
||||
- Fix: [#15844] Tile Inspector has inconsistent text colours.
|
||||
|
|
|
@ -71,18 +71,19 @@ int32_t map_place_non_scenery_clear_func(TileElement** tile_element, const Coord
|
|||
}
|
||||
|
||||
static bool MapLoc68BABCShouldContinue(
|
||||
TileElement* tileElement, const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, uint8_t flags, money32& price,
|
||||
TileElement** tileElementPtr, const CoordsXYRangedZ& pos, CLEAR_FUNC clearFunc, uint8_t flags, money32& price,
|
||||
uint8_t crossingMode, bool canBuildCrossing)
|
||||
{
|
||||
if (clearFunc != nullptr)
|
||||
{
|
||||
if (!clearFunc(&tileElement, pos, flags, &price))
|
||||
if (!clearFunc(tileElementPtr, pos, flags, &price))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Crossing mode 1: building track over path
|
||||
auto tileElement = *tileElementPtr;
|
||||
if (crossingMode == 1 && canBuildCrossing && tileElement->GetType() == TILE_ELEMENT_TYPE_PATH
|
||||
&& tileElement->GetBaseZ() == pos.baseZ && !tileElement->AsPath()->IsQueue() && !tileElement->AsPath()->IsSloped())
|
||||
{
|
||||
|
@ -153,7 +154,7 @@ GameActions::Result::Ptr MapCanConstructWithClearAt(
|
|||
if (tileElement->GetOccupiedQuadrants() & (quarterTile.GetBaseQuarterOccupied()))
|
||||
{
|
||||
if (MapLoc68BABCShouldContinue(
|
||||
tileElement, pos, clearFunc, flags, res->Cost, crossingMode, canBuildCrossing))
|
||||
&tileElement, pos, clearFunc, flags, res->Cost, crossingMode, canBuildCrossing))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -250,7 +251,7 @@ GameActions::Result::Ptr MapCanConstructWithClearAt(
|
|||
continue;
|
||||
}
|
||||
|
||||
if (MapLoc68BABCShouldContinue(tileElement, pos, clearFunc, flags, res->Cost, crossingMode, canBuildCrossing))
|
||||
if (MapLoc68BABCShouldContinue(&tileElement, pos, clearFunc, flags, res->Cost, crossingMode, canBuildCrossing))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue