Changeset - r5953:3e2cdc2f29e1
[Not reviewed]
master
0 2 0
rubidium - 18 years ago 2007-02-07 17:52:21
rubidium@openttd.org
(svn r8619) -Fix: store the ownership of a water tile in the buoy tile and set the ownership of the water tile when the buoy is removed. This solves the issue of removing ownership from canal tiles thus making is possible for other players to remove the canal tile.
2 files changed with 13 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/station_cmd.cpp
Show inline comments
 
@@ -1806,7 +1806,15 @@ static int32 RemoveBuoy(Station *st, uin
 
		st->facilities &= ~FACIL_DOCK;
 
		st->had_vehicle_of_type &= ~HVOT_BUOY;
 

	
 
		MakeWater(tile);
 
		/* We have to set the water tile's state to the same state as before the
 
		 * buoy was placed. Otherwise one could plant a buoy on a canal edge,
 
		 * remove it and flood the land (if the canal edge is at level 0) */
 
		Owner o = GetTileOwner(tile);
 
		if (o == OWNER_WATER) {
 
			MakeWater(tile);
 
		} else {
 
			MakeCanal(tile, o);
 
		}
 
		MarkTileDirtyByTile(tile);
 

	
 
		UpdateStationVirtCoordDirty(st);
src/station_map.h
Show inline comments
 
@@ -287,7 +287,10 @@ static inline void MakeAirport(TileIndex
 

	
 
static inline void MakeBuoy(TileIndex t, StationID sid)
 
{
 
	MakeStation(t, OWNER_NONE, sid, GFX_BUOY_BASE);
 
	/* Make the owner of the buoy tile the same as the current owner of the
 
	 * water tile. In this way, we can reset the owner of the water to its
 
	 * original state when the buoy gets removed. */
 
	MakeStation(t, GetTileOwner(t), sid, GFX_BUOY_BASE);
 
}
 

	
 
static inline void MakeDock(TileIndex t, Owner o, StationID sid, DiagDirection d)
0 comments (0 inline, 0 general)