summaryrefslogtreecommitdiff
path: root/unmovable_cmd.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2004-09-03 17:57:27 +0000
committerdarkvater <darkvater@openttd.org>2004-09-03 17:57:27 +0000
commit7b02cd3248650d0ece425b7640a9631f2d26c067 (patch)
treea7cb9d6999e2ad750ce6c0217f7e84aa1920584e /unmovable_cmd.c
parentb5a0840621d291ed384f2abac305a850bf1eeea3 (diff)
downloadopenttd-7b02cd3248650d0ece425b7640a9631f2d26c067.tar.xz
(svn r150) -Fix: [1010833] Turning on the magic bulldozer removes oil rigs
-Fix: [993493] Buildings on water -Feature: Water floods everything, including vehicles.
Diffstat (limited to 'unmovable_cmd.c')
-rw-r--r--unmovable_cmd.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/unmovable_cmd.c b/unmovable_cmd.c
index 1c6d26f5b..0cdc67a5e 100644
--- a/unmovable_cmd.c
+++ b/unmovable_cmd.c
@@ -114,39 +114,24 @@ static uint GetSlopeTileh_Unmovable(TileInfo *ti)
static int32 ClearTile_Unmovable(uint tile, byte flags)
{
byte m5 = _map5[tile];
- //Town *t;
if (m5 & 0x80) {
if (_current_player == OWNER_WATER)
- return DoCommandByTile(tile, OWNER_WATER, 0, flags, CMD_DESTROY_COMPANY_HQ);
+ return DoCommandByTile(tile, OWNER_WATER, 0, DC_EXEC, CMD_DESTROY_COMPANY_HQ);
return_cmd_error(STR_5804_COMPANY_HEADQUARTERS_IN);
}
if (m5 == 3) // company owned land
return DoCommandByTile(tile, 0, 0, flags, CMD_SELL_LAND_AREA);
- //t = ClosestTownFromTile(tile, _patches.dist_local_authority + 20); // needed for town penalty
-
- // checks if you're allowed to remove unmovable things. no remove under rating "%difficulty setting"
- if (_game_mode != GM_EDITOR) {
- if (flags & DC_AUTO || !_cheats.magic_bulldozer.value)
- return_cmd_error(STR_5800_OBJECT_IN_THE_WAY);
-
- /*if (!CheckforTownRating(tile, flags, t, UNMOVEABLE_REMOVE))
- return CMD_ERROR;
- */
-
- }
+ // checks if you're allowed to remove unmovable things
+ if (_game_mode != GM_EDITOR && _current_player != OWNER_WATER && ((flags & DC_AUTO || !_cheats.magic_bulldozer.value)) )
+ return_cmd_error(STR_5800_OBJECT_IN_THE_WAY);
if (flags & DC_EXEC) {
DoClearSquare(tile);
- // decreases the town rating by 250;
- /*if (_game_mode != GM_EDITOR)
- ChangeTownRating(t, -250, -100);
- */
}
- // return _price.build_industry*0.34;
return 0;
}