clear_map.h
changeset 4328 1b3940c35724
parent 3516 4dde641ee82a
child 4666 172a0cdf28a6
--- a/clear_map.h	Sun Aug 20 18:43:43 2006 +0000
+++ b/clear_map.h	Sun Aug 20 18:44:26 2006 +0000
@@ -83,6 +83,17 @@
 	SB(_m[t].m3, 0, 4, f);
 }
 
+static inline uint16 GetIndustryIndexOfField(TileIndex t)
+{
+	assert(GetClearGround(t) == CLEAR_FIELDS);
+	return _m[t].m2;
+}
+
+static inline void SetIndustryIndexOfField(TileIndex t, uint16 i)
+{
+	assert(GetClearGround(t) == CLEAR_FIELDS);
+	_m[t].m2 = i;
+}
 
 /* Is used by tree tiles, too */
 static inline uint GetFenceSE(TileIndex t)
@@ -121,11 +132,11 @@
 }
 
 
-static inline void MakeField(TileIndex t, uint field_type)
+static inline void MakeField(TileIndex t, uint field_type, uint16 industry)
 {
 	SetTileType(t, MP_CLEAR);
 	SetTileOwner(t, OWNER_NONE);
-	_m[t].m2 = 0;
+	_m[t].m2 = industry;
 	_m[t].m3 = field_type;
 	_m[t].m4 = 0 << 5 | 0 << 2;
 	SetClearGroundDensity(t, CLEAR_FIELDS, 3);