Changeset - r17758:819a83be141e
[Not reviewed]
master
0 2 0
frosch - 13 years ago 2011-06-11 20:47:31
frosch@openttd.org
(svn r22552) -Fix: Clear airport persistent storage on construction/removal of airports.
2 files changed with 8 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/newgrf_storage.h
Show inline comments
 
@@ -62,6 +62,12 @@ struct PersistentStorageArray : BaseStor
 
		free(this->prev_storage);
 
	}
 

	
 
	/** Resets all values to zero. */
 
	void ResetToZero()
 
	{
 
		memset(this->storage, 0, sizeof(this->storage));
 
	}
 

	
 
	/**
 
	 * Stores some value at a given position.
 
	 * If there is no backup of the data that backup is made and then
src/station_cmd.cpp
Show inline comments
 
@@ -2191,6 +2191,7 @@ CommandCost CmdBuildAirport(TileIndex ti
 
		st->airport.layout = layout;
 
		st->airport.flags = 0;
 
		st->airport.rotation = rotation;
 
		st->airport.psa.ResetToZero();
 

	
 
		st->rect.BeforeAddRect(tile, w, h, StationRect::ADD_TRY);
 

	
 
@@ -2287,6 +2288,7 @@ static CommandCost RemoveAirport(TileInd
 

	
 
		st->airport.Clear();
 
		st->facilities &= ~FACIL_AIRPORT;
 
		st->airport.psa.ResetToZero();
 

	
 
		SetWindowWidgetDirty(WC_STATION_VIEW, st->index, SVW_PLANES);
 

	
0 comments (0 inline, 0 general)