changeset 17852:66f7bfbb94b8 draft

(svn r22643) -Fix: Disallow building NewObjects on water tiles owned by another company.
author michi_cc <michi_cc@openttd.org>
date Fri, 08 Jul 2011 14:42:18 +0000
parents 8182cf0762b2
children 71b5046c83c4
files src/object_cmd.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/object_cmd.cpp
+++ b/src/object_cmd.cpp
@@ -214,6 +214,10 @@
 					/* 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);