src/water_map.h
branchnoai
changeset 9723 eee46cb39750
parent 9722 ebf0ece7d8f6
child 9724 b39bc69bb2f2
--- a/src/water_map.h	Fri Nov 23 16:59:30 2007 +0000
+++ b/src/water_map.h	Wed Jan 09 18:11:12 2008 +0000
@@ -31,9 +31,9 @@
 
 	if (_m[t].m5 == 0) return WATER_TILE_CLEAR;
 	if (_m[t].m5 == 1) return WATER_TILE_COAST;
-	if (IS_INT_INSIDE(_m[t].m5, LOCK_MIDDLE, LOCK_END)) return WATER_TILE_LOCK;
+	if (IsInsideMM(_m[t].m5, LOCK_MIDDLE, LOCK_END)) return WATER_TILE_LOCK;
 
-	assert(IS_INT_INSIDE(_m[t].m5, DEPOT_NORTH, DEPOT_END));
+	assert(IsInsideMM(_m[t].m5, DEPOT_NORTH, DEPOT_END));
 	return WATER_TILE_DEPOT;
 }
 
@@ -72,7 +72,7 @@
 
 static inline TileIndex IsShipDepot(TileIndex t)
 {
-	return IS_INT_INSIDE(_m[t].m5, DEPOT_NORTH, DEPOT_END);
+	return IsInsideMM(_m[t].m5, DEPOT_NORTH, DEPOT_END);
 }
 
 static inline Axis GetShipDepotAxis(TileIndex t)
@@ -85,6 +85,11 @@
 	return XYNSToDiagDir(GetShipDepotAxis(t), GB(_m[t].m5, 0, 1));
 }
 
+static inline Owner GetShipDepotWaterOwner(TileIndex t)
+{
+	return (Owner)_m[t].m4;
+}
+
 static inline DiagDirection GetLockDirection(TileIndex t)
 {
 	return (DiagDirection)GB(_m[t].m5, 0, 2);
@@ -128,13 +133,13 @@
 	_m[t].m5 = 0;
 }
 
-static inline void MakeShipDepot(TileIndex t, Owner o, DepotPart base, Axis a)
+static inline void MakeShipDepot(TileIndex t, Owner o, DepotPart base, Axis a, Owner original_owner)
 {
 	SetTileType(t, MP_WATER);
 	SetTileOwner(t, o);
 	_m[t].m2 = 0;
 	_m[t].m3 = 0;
-	_m[t].m4 = 0;
+	_m[t].m4 = original_owner;
 	_m[t].m5 = base + a * 2;
 }