1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-02-01 11:15:13 +01:00

#15634: Refactor passing GameActions::Result by copy (#15951)

* Refactor to result GameActions::Result as copy instead of unique_ptr

* Remove alias GameActions::Result::Ptr

* Remove MakeResult wrapper

* Remove type forwarder in TileInspector
This commit is contained in:
ζeh Matt
2021-11-23 23:35:08 -08:00
committed by GitHub
parent 23491c8125
commit 83b911b193
191 changed files with 1983 additions and 1978 deletions

View File

@@ -1548,7 +1548,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
auto parkEntranceRemoveAction = ParkEntranceRemoveAction(CoordsXYZ{ seqLoc, element->GetBaseZ() });
auto result = GameActions::ExecuteNested(&parkEntranceRemoveAction);
// If asking nicely did not work, forcibly remove this to avoid an infinite loop.
if (result->Error != GameActions::Status::Ok)
if (result.Error != GameActions::Status::Ok)
{
tile_element_remove(element);
}
@@ -1560,7 +1560,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
auto wallRemoveAction = WallRemoveAction(wallLocation);
auto result = GameActions::ExecuteNested(&wallRemoveAction);
// If asking nicely did not work, forcibly remove this to avoid an infinite loop.
if (result->Error != GameActions::Status::Ok)
if (result.Error != GameActions::Status::Ok)
{
tile_element_remove(element);
}
@@ -1572,7 +1572,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
{ loc.x, loc.y, element->GetBaseZ(), element->GetDirection() }, element->AsLargeScenery()->GetSequenceIndex());
auto result = GameActions::ExecuteNested(&removeSceneryAction);
// If asking nicely did not work, forcibly remove this to avoid an infinite loop.
if (result->Error != GameActions::Status::Ok)
if (result.Error != GameActions::Status::Ok)
{
tile_element_remove(element);
}
@@ -1584,7 +1584,7 @@ static void clear_element_at(const CoordsXY& loc, TileElement** elementPtr)
{ loc.x, loc.y, element->GetBaseZ(), element->AsBanner()->GetPosition() });
auto result = GameActions::ExecuteNested(&bannerRemoveAction);
// If asking nicely did not work, forcibly remove this to avoid an infinite loop.
if (result->Error != GameActions::Status::Ok)
if (result.Error != GameActions::Status::Ok)
{
tile_element_remove(element);
}