1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 16:54:52 +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

@@ -43,24 +43,24 @@ void SignSetNameAction::Serialise(DataSerialiser& stream)
stream << DS_TAG(_bannerIndex) << DS_TAG(_name);
}
GameActions::Result::Ptr SignSetNameAction::Query() const
GameActions::Result SignSetNameAction::Query() const
{
auto banner = GetBanner(_bannerIndex);
if (banner == nullptr)
{
log_warning("Invalid game command for setting sign name, banner id = %d", _bannerIndex);
return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE);
}
return MakeResult();
return GameActions::Result();
}
GameActions::Result::Ptr SignSetNameAction::Execute() const
GameActions::Result SignSetNameAction::Execute() const
{
auto banner = GetBanner(_bannerIndex);
if (banner == nullptr)
{
log_warning("Invalid game command for setting sign name, banner id = %d", _bannerIndex);
return MakeResult(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE);
return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE);
}
if (!_name.empty())
@@ -89,5 +89,5 @@ GameActions::Result::Ptr SignSetNameAction::Execute() const
scrolling_text_invalidate();
gfx_invalidate_screen();
return MakeResult();
return GameActions::Result();
}