MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / PlantRandomFarmField

Function PlantRandomFarmField

src/industry_cmd.cpp:1099–1107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1097}
1098
1099void PlantRandomFarmField(const Industry *i)
1100{
1101 int x = i->location.w / 2 + Random() % 31 - 16;
1102 int y = i->location.h / 2 + Random() % 31 - 16;
1103
1104 TileIndex tile = TileAddWrap(i->location.tile, x, y);
1105
1106 if (tile != INVALID_TILE) PlantFarmField(tile, i->index);
1107}
1108
1109/**
1110 * Perform a circular search around the Lumber Mill in order to find trees to cut

Callers 3

ProduceIndustryGoodsFunction · 0.85
DoCreateNewIndustryFunction · 0.85
AfterLoadGameFunction · 0.85

Calls 3

TileAddWrapFunction · 0.85
PlantFarmFieldFunction · 0.85
RandomFunction · 0.50

Tested by

no test coverage detected