(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

@@ -83,6 +83,17 @@ static inline void SetFieldType(TileIndex t, uint f)
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 MakeClear(TileIndex t, ClearGround g, uint density)
}
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);