Changeset - r27:ceebb2332771
[Not reviewed]
master
0 1 0
darkvater - 20 years ago 2004-08-12 20:24:28
darkvater@openttd.org
(svn r28) -Fix removing station merged with oilrig, will reset oilrigs ownership
1 file changed with 9 insertions and 1 deletions:
0 comments (0 inline, 0 general)
station_cmd.c
Show inline comments
 
@@ -535,14 +535,22 @@ static void UpdateStationAcceptance(Stat
 
// This is called right after a station was deleted.
 
// It checks if the whole station is free of substations, and if so, the station will be
 
// deleted after a little while.
 
static void DeleteStationIfEmpty(Station *st) {
 
	if (st->facilities == 0) {
 
		st->delete_ctr = 0;
 
	}
 

	
 
	// if a station next to an oilrig is removed, fix ownership
 
	if (st->airport_type == AT_OILRIG && st->facilities == (FACIL_AIRPORT|FACIL_DOCK) ) {
 
		_station_sort_dirty = true;
 
		InvalidateWindow(WC_STATION_LIST, st->owner);
 
		st->owner = 0x10;
 
	}
 

	
 
	InvalidateWindow(WC_STATION_LIST, st->owner);
 
}
 

	
 
// Tries to clear the given area. Returns the cost in case of success.
 
// Or an error code if it failed.
 
int32 CheckFlatLandBelow(uint tile, uint w, uint h, uint flags, uint invalid_dirs, int *station)
 
{
 
@@ -2316,13 +2324,13 @@ void BuildOilRig(uint tile)
 
			_map5[tile] = 0x4B;
 
			_map_owner[tile] = OWNER_NONE;
 
			_map3_lo[tile] = 0;
 
			_map3_hi[tile] = 0;
 
			_map2[tile] = st->index;
 

	
 
			st->owner = 0x10;
 
			st->owner = OWNER_NONE;
 
      st->airport_flags = 0;
 
			st->airport_type = AT_OILRIG;
 
			st->xy = tile;
 
			st->bus_tile = 0;
 
			st->lorry_tile = 0;
 
			st->airport_tile = tile;
0 comments (0 inline, 0 general)