mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Fix ClearAction breaking out of the loop too early.
This commit is contained in:
@@ -158,12 +158,12 @@ private:
|
||||
auto res = executing ? GameActions::ExecuteNested(&footpathRemoveAction)
|
||||
: GameActions::QueryNested(&footpathRemoveAction);
|
||||
|
||||
if (res->Error != GA_ERROR::OK)
|
||||
return MONEY32_UNDEFINED;
|
||||
|
||||
if (res->Error == GA_ERROR::OK)
|
||||
{
|
||||
totalCost += res->Cost;
|
||||
tileEdited = executing;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_SMALL_SCENERY:
|
||||
if (_itemsToClear & CLEARABLE_ITEMS::SCENERY_SMALL)
|
||||
@@ -176,12 +176,12 @@ private:
|
||||
auto res = executing ? GameActions::ExecuteNested(&removeSceneryAction)
|
||||
: GameActions::QueryNested(&removeSceneryAction);
|
||||
|
||||
if (res->Error != GA_ERROR::OK)
|
||||
return MONEY32_UNDEFINED;
|
||||
|
||||
if (res->Error == GA_ERROR::OK)
|
||||
{
|
||||
totalCost += res->Cost;
|
||||
tileEdited = executing;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_WALL:
|
||||
if (_itemsToClear & CLEARABLE_ITEMS::SCENERY_SMALL)
|
||||
@@ -193,12 +193,12 @@ private:
|
||||
auto res = executing ? GameActions::ExecuteNested(&wallRemoveAction)
|
||||
: GameActions::QueryNested(&wallRemoveAction);
|
||||
|
||||
if (res->Error != GA_ERROR::OK)
|
||||
return MONEY32_UNDEFINED;
|
||||
|
||||
if (res->Error == GA_ERROR::OK)
|
||||
{
|
||||
totalCost += res->Cost;
|
||||
tileEdited = executing;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case TILE_ELEMENT_TYPE_LARGE_SCENERY:
|
||||
if (_itemsToClear & CLEARABLE_ITEMS::SCENERY_LARGE)
|
||||
@@ -211,12 +211,12 @@ private:
|
||||
auto res = executing ? GameActions::ExecuteNested(&removeSceneryAction)
|
||||
: GameActions::QueryNested(&removeSceneryAction);
|
||||
|
||||
if (res->Error != GA_ERROR::OK)
|
||||
return MONEY32_UNDEFINED;
|
||||
|
||||
if (res->Error == GA_ERROR::OK)
|
||||
{
|
||||
totalCost += res->Cost;
|
||||
tileEdited = executing;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
} while (!tileEdited && !(tileElement++)->IsLastForTile());
|
||||
|
||||
Reference in New Issue
Block a user