1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-27 16:39:09 +00:00

(svn r6001) -Feature: when removing a farm, his farmland is removed too (over time) (based on peter1138's patch, FS#82)

To make this to work, in older games farmland is removed on load, and replanted
This commit is contained in:
truelight
2006-08-20 18:44:26 +00:00
parent e5fb66a23f
commit 9e755051a1
6 changed files with 75 additions and 22 deletions

View File

@@ -16,6 +16,7 @@
#include "table/sprites.h"
#include "unmovable_map.h"
#include "genworld.h"
#include "industry.h"
typedef struct TerraformerHeightMod {
TileIndex tile;
@@ -679,9 +680,14 @@ static void TileLoop_Clear(TileIndex tile)
SetClearCounter(tile, 0);
}
field_type = GetFieldType(tile);
field_type = (field_type < 8) ? field_type + 1 : 0;
SetFieldType(tile, field_type);
if (GetIndustryIndexOfField(tile) == INVALID_INDUSTRY) {
/* This farmfield is no longer farmfield, so make it grass again */
MakeClear(tile, CLEAR_GRASS, 0);
} else {
field_type = GetFieldType(tile);
field_type = (field_type < 8) ? field_type + 1 : 0;
SetFieldType(tile, field_type);
}
break;
}