summaryrefslogtreecommitdiff
path: root/industry_cmd.c
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2004-08-24 12:54:37 +0000
committertruelight <truelight@openttd.org>2004-08-24 12:54:37 +0000
commita0ba5a79394c4a6b8087bf5f2d076bba7ff13135 (patch)
tree897b6585f4866af42f4b45e81f6c517977a93d05 /industry_cmd.c
parentc32166a5c9d6cd969bdc3a6942b62286a685d26f (diff)
downloadopenttd-a0ba5a79394c4a6b8087bf5f2d076bba7ff13135.tar.xz
(svn r132) -Fix: [1014278] TileAddWrap() gave wrong results. Fixed now.
Diffstat (limited to 'industry_cmd.c')
-rw-r--r--industry_cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/industry_cmd.c b/industry_cmd.c
index 031540510..067a91458 100644
--- a/industry_cmd.c
+++ b/industry_cmd.c
@@ -969,7 +969,7 @@ static void MaybePlantFarmField(Industry *i)
{
uint tile;
if (CHANCE16(1,8)) {
- tile = TileAddWrap(i->xy, TILE_XY(i->width>>1, i->height>>1) + (Random()&TILE_XY(31,31))-TILE_XY(16,16));
+ tile = TileAddWrap(i->xy, ((i->width>>1) + Random() % 31 - 16), ((i->height>>1) + Random() % 31 - 16));
if (tile != TILE_WRAPPED)
PlantFarmField(tile);
}
@@ -1473,10 +1473,10 @@ static void DoCreateNewIndustry(Industry *i, uint tile, int type, const Industry
if (i->type == IT_FARM || i->type == IT_FARM_2) {
tile = i->xy + TILE_XY((i->width >> 1), (i->height >> 1));
for(j=0; j!=50; j++) {
- uint new_tile = TileAddWrap(tile, (Random() & TILE_XY(31,31)) - TILE_XY(16,16));
+ uint new_tile = TileAddWrap(tile, Random() % 31 - 16, Random() % 31 - 16);
if (new_tile != TILE_WRAPPED)
PlantFarmField(new_tile);
- }
+ }
}
_industry_sort_dirty = true;
InvalidateWindow(WC_INDUSTRY_DIRECTORY, 0);