Codechange: move from C-string to std::string for DoCommand

This commit is contained in:
rubidium42
2021-05-29 16:09:25 +02:00
committed by rubidium42
parent 661728558e
commit 2e136285e1
38 changed files with 183 additions and 186 deletions

View File

@@ -199,7 +199,7 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags);
* @param text unused
* @return the cost of this operation or an error
*/
CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text)
{
CommandCost cost(EXPENSES_PROPERTY);
@@ -769,7 +769,7 @@ void GenerateObjects()
default:
uint8 view = RandomRange(spec->views);
if (CmdBuildObject(RandomTile(), DC_EXEC | DC_AUTO | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, i, view, nullptr).Succeeded()) amount--;
if (CmdBuildObject(RandomTile(), DC_EXEC | DC_AUTO | DC_NO_TEST_TOWN_RATING | DC_NO_MODIFY_TOWN_RATING, i, view, {}).Succeeded()) amount--;
break;
}
}