|
@@ -196,13 +196,13 @@ static CommandCost ClearTile_Object(Tile
|
|
|
* @param flags type of operation
|
|
|
* @param p1 the object type to build
|
|
|
* @param p2 the view for the object
|
|
|
* @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);
|
|
|
|
|
|
ObjectType type = (ObjectType)GB(p1, 0, 16);
|
|
|
if (type >= NUM_OBJECTS) return CMD_ERROR;
|
|
|
uint8 view = GB(p2, 0, 2);
|
|
@@ -766,13 +766,13 @@ void GenerateObjects()
|
|
|
case OBJECT_LIGHTHOUSE:
|
|
|
if (TryBuildLightHouse()) amount--;
|
|
|
break;
|
|
|
|
|
|
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;
|
|
|
}
|
|
|
}
|
|
|
IncreaseGeneratingWorldProgress(GWP_OBJECT);
|
|
|
}
|
|
|
}
|