summaryrefslogtreecommitdiff
path: root/src/water_map.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-12-07 21:14:54 +0000
committerrubidium <rubidium@openttd.org>2007-12-07 21:14:54 +0000
commitcbb2d39860a847687019ab47095646e593fb5bc8 (patch)
tree564b72840ffd1f1485b52afdcd03fc9e08aaab24 /src/water_map.h
parentc21f588a14f30fed3d683b4686975670adaf7ed5 (diff)
downloadopenttd-cbb2d39860a847687019ab47095646e593fb5bc8.tar.xz
(svn r11589) -Fix [FS#1514]: when ship depots got destroyed they always returned to water, even when it should've been canals.
Diffstat (limited to 'src/water_map.h')
-rw-r--r--src/water_map.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/water_map.h b/src/water_map.h
index 5d1a60c1d..c4c131173 100644
--- a/src/water_map.h
+++ b/src/water_map.h
@@ -85,6 +85,11 @@ static inline DiagDirection GetShipDepotDirection(TileIndex t)
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 @@ static inline void MakeCanal(TileIndex t, Owner o)
_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;
}