From 8565703a4c86c776665df6dae5bb6bdab949ce58 Mon Sep 17 00:00:00 2001 From: michi_cc Date: Fri, 8 Jul 2011 14:42:18 +0000 Subject: [PATCH] (svn r22643) -Fix: Disallow building NewObjects on water tiles owned by another company. --- src/object_cmd.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 4425d1118b..9fc5b8ee0e 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);