summaryrefslogtreecommitdiff
path: root/clear_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'clear_cmd.c')
-rw-r--r--clear_cmd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/clear_cmd.c b/clear_cmd.c
index eab094d5d..df7763a7e 100644
--- a/clear_cmd.c
+++ b/clear_cmd.c
@@ -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;
}