FS#82 - Farm fields 'die' if their farm shuts down

Attached to Project: OpenTTD
Opened by Peter Nelson (peter1138) - Saturday, 25 March 2006, 09:27 GMT
Last edited by Bjarni (Bjarni) - Sunday, 20 August 2006, 19:58 GMT
Type Patch
Category Core
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Low
Reported Version trunk
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


This patch causes farm fields to be removed after their farm has shut down.

This is achieved by storing the industry id of the farm in m2 for the fields. If the farm is removed, those fields have m2 set to 0xffff (effectively INVALID_INDUSTRY, although that doesn't exist yet) and they are then removed during the tile loop.

No attempt has been made to convert existing fields, so only fields of new farms (or new games) with this patch will be removed.
This task depends upon

Closed by  Bjarni (Bjarni)
Sunday, 20 August 2006, 19:58 GMT
Reason for closing:  Implemented
Comment by Patric Stout (TrueBrain) - Sunday, 20 August 2006, 12:51 GMT
Very nice patch. I updated it a bit, added INVALID_INDUSTRY and some comments.

Also, on load, all farmland is destroyed and new farmland is made for older savegames.

Very nice job :)
Comment by Patric Stout (TrueBrain) - Sunday, 20 August 2006, 13:08 GMT
And yet an other new version, which will be applied after past2090 commit later tonight.