diff options
author | peter1138 <peter1138@openttd.org> | 2006-06-03 15:10:39 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2006-06-03 15:10:39 +0000 |
commit | 59d5ed821f814b3693a05b7f8ea61f449db4c54a (patch) | |
tree | ffeb9c12c3b758ab755bc68829298c9099d230f0 /water_map.h | |
parent | d7261da206b81bccc5d370e79cecd5a0f9983de0 (diff) | |
download | openttd-59d5ed821f814b3693a05b7f8ea61f449db4c54a.tar.xz |
(svn r5084) - Add owner attribute to canals and locks. This makes them more useful in multiplayer games, as before, anyone could delete any canal or lock tile. This doesn't affect whose ships can use whose canals or locks.
Diffstat (limited to 'water_map.h')
-rw-r--r-- | water_map.h | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/water_map.h b/water_map.h index b9a8ea76d..ff8ec21a4 100644 --- a/water_map.h +++ b/water_map.h @@ -95,6 +95,16 @@ static inline void MakeShore(TileIndex t) _m[t].m5 = 1; } +static inline void MakeCanal(TileIndex t, Owner o) +{ + SetTileType(t, MP_WATER); + SetTileOwner(t, o); + _m[t].m2 = 0; + _m[t].m3 = 0; + _m[t].m4 = 0; + _m[t].m5 = 0; +} + static inline void MakeShipDepot(TileIndex t, Owner o, DepotPart base, Axis a) { SetTileType(t, MP_WATER); @@ -105,23 +115,23 @@ static inline void MakeShipDepot(TileIndex t, Owner o, DepotPart base, Axis a) _m[t].m5 = base + a * 2; } -static inline void MakeLockTile(TileIndex t, byte section) +static inline void MakeLockTile(TileIndex t, Owner o, byte section) { SetTileType(t, MP_WATER); - SetTileOwner(t, OWNER_WATER); + SetTileOwner(t, o); _m[t].m2 = 0; _m[t].m3 = 0; _m[t].m4 = 0; _m[t].m5 = section; } -static inline void MakeLock(TileIndex t, DiagDirection d) +static inline void MakeLock(TileIndex t, Owner o, DiagDirection d) { TileIndexDiff delta = TileOffsByDir(d); - MakeLockTile(t, LOCK_MIDDLE + d); - MakeLockTile(t - delta, LOCK_LOWER + d); - MakeLockTile(t + delta, LOCK_UPPER + d); + MakeLockTile(t, o, LOCK_MIDDLE + d); + MakeLockTile(t - delta, o, LOCK_LOWER + d); + MakeLockTile(t + delta, o, LOCK_UPPER + d); } #endif |