Codechange: Don't use globals for story/goal/sign/group command proc return values.

This commit is contained in:
Michael Lutz
2021-11-30 22:59:23 +01:00
parent 3e85e833a7
commit 57b82e2e99
23 changed files with 105 additions and 236 deletions

View File

@@ -1017,9 +1017,9 @@ void CcFoundTown(Commands cmd, const CommandCost &result, TileIndex tile)
if (!_settings_client.gui.persistent_buildingtools) ResetObjectToPlace();
}
void CcFoundRandomTown(Commands cmd, const CommandCost &result, TileIndex tile)
void CcFoundRandomTown(Commands cmd, const CommandCost &result, TownID town_id)
{
if (result.Succeeded()) ScrollMainWindowToTile(Town::Get(_new_town_id)->xy);
if (result.Succeeded()) ScrollMainWindowToTile(Town::Get(town_id)->xy);
}
static const NWidgetPart _nested_found_town_widgets[] = {
@@ -1150,7 +1150,8 @@ public:
this->SetDirty();
}
void ExecuteFoundTownCommand(TileIndex tile, bool random, StringID errstr, CommandCallback cc)
template <typename Tcallback>
void ExecuteFoundTownCommand(TileIndex tile, bool random, StringID errstr, Tcallback cc)
{
std::string name;