mirror of https://github.com/OpenTTD/OpenTTD
(svn r22643) -Fix: Disallow building NewObjects on water tiles owned by another company.
parent
a6ce6c144b
commit
8565703a4c
|
@ -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
|
/* Normal water tiles don't have to be cleared. For all other tile types clear
|
||||||
* the tile but leave the water. */
|
* the tile but leave the water. */
|
||||||
cost.AddCost(DoCommand(t, 0, 0, flags & ~DC_NO_WATER, CMD_LANDSCAPE_CLEAR));
|
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 {
|
} else {
|
||||||
if (!allow_ground) return_cmd_error(STR_ERROR_MUST_BE_BUILT_ON_WATER);
|
if (!allow_ground) return_cmd_error(STR_ERROR_MUST_BE_BUILT_ON_WATER);
|
||||||
|
|
Loading…
Reference in New Issue