diff options
author | michi_cc <michi_cc@openttd.org> | 2011-07-08 14:42:18 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2011-07-08 14:42:18 +0000 |
commit | 8565703a4c86c776665df6dae5bb6bdab949ce58 (patch) | |
tree | 0653c6f5d08ec926d6d907b250923e44ed29aef4 | |
parent | a6ce6c144b77e24a4555e5ecb6f6fcbddd1c70d5 (diff) | |
download | openttd-8565703a4c86c776665df6dae5bb6bdab949ce58.tar.xz |
(svn r22643) -Fix: Disallow building NewObjects on water tiles owned by another company.
-rw-r--r-- | src/object_cmd.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 4425d1118..9fc5b8ee0 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -214,6 +214,10 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 /* Normal water tiles don't have to be cleared. For all other tile types clear * the tile but leave the water. */ cost.AddCost(DoCommand(t, 0, 0, flags & ~DC_NO_WATER, CMD_LANDSCAPE_CLEAR)); + } else { + /* Can't build on water owned by another company. */ + Owner o = GetTileOwner(t); + if (o != OWNER_NONE && o != OWNER_WATER) cost.AddCost(CheckOwnership(o, t)); } } else { if (!allow_ground) return_cmd_error(STR_ERROR_MUST_BE_BUILT_ON_WATER); |