2005-07-24 14:12:37 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
|
|
|
|
* OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
* See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-06 15:11:33 +00:00
|
|
|
/** @file unmovable_cmd.cpp Handling of unmovable tiles. */
|
2007-04-04 04:08:47 +00:00
|
|
|
|
2004-08-09 17:04:08 +00:00
|
|
|
#include "stdafx.h"
|
2007-04-12 13:07:15 +00:00
|
|
|
#include "landscape.h"
|
2007-12-21 21:50:46 +00:00
|
|
|
#include "command_func.h"
|
2008-01-09 09:45:45 +00:00
|
|
|
#include "viewport_func.h"
|
2008-09-30 20:51:04 +00:00
|
|
|
#include "company_base.h"
|
2004-08-09 17:04:08 +00:00
|
|
|
#include "town.h"
|
2007-07-08 18:40:15 +00:00
|
|
|
#include "bridge_map.h"
|
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
- New optional landscape generator (TerraGenesis Perlin)
- Load heightmaps (either BMP or PNG)
- Progress dialog while generating worlds (no longer a 'hanging' screen)
- New dialogs for NewGame, Create Scenario and Play Heightmap
- Easier to configure your landscape
- More things to configure (tree-placer, ..)
- Speedup of world generation
- New console command 'restart': restart the map EXACTLY as it was when you
first started it (needs a game made after or with this commit)
- New console command 'getseed': get the seed of your map and share it with
others (of course only works with generated maps)
- Many new, world generation related, things
- Many internal cleanups and rewrites
Many tnx to those people who helped making this:
Belugas, DaleStan, glx, KUDr, RichK67, Rubidium, and TrueLight (alfabetic)
Many tnx to those who helped testing:
Arnau, Bjarni, and tokai (alfabetic)
And to all other people who helped testing and sending comments / bugs
Stats: 673 lines changed, 3534 new lines, 79 new strings
2006-08-19 10:00:30 +00:00
|
|
|
#include "genworld.h"
|
2007-09-14 22:27:40 +00:00
|
|
|
#include "autoslope.h"
|
2007-11-10 01:17:15 +00:00
|
|
|
#include "transparency.h"
|
2007-12-25 11:26:07 +00:00
|
|
|
#include "functions.h"
|
|
|
|
#include "window_func.h"
|
2008-01-07 00:45:05 +00:00
|
|
|
#include "vehicle_func.h"
|
2008-09-30 20:51:04 +00:00
|
|
|
#include "company_gui.h"
|
2009-01-31 20:16:06 +00:00
|
|
|
#include "cheat_type.h"
|
2008-05-07 09:07:19 +00:00
|
|
|
#include "landscape_type.h"
|
2009-02-05 03:41:42 +00:00
|
|
|
#include "unmovable.h"
|
2009-08-08 16:42:55 +00:00
|
|
|
#include "cargopacket.h"
|
2010-01-15 16:41:15 +00:00
|
|
|
#include "sprite.h"
|
|
|
|
#include "core/random_func.hpp"
|
|
|
|
#include "unmovable_map.h"
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2008-01-13 01:21:35 +00:00
|
|
|
#include "table/strings.h"
|
|
|
|
#include "table/sprites.h"
|
|
|
|
#include "table/unmovable_land.h"
|
|
|
|
|
2010-08-02 21:35:59 +00:00
|
|
|
/* static */ const UnmovableSpec *UnmovableSpec::Get(UnmovableType index)
|
2010-08-02 20:57:32 +00:00
|
|
|
{
|
|
|
|
assert(index < UNMOVABLE_MAX);
|
|
|
|
return &_original_unmovable[index];
|
|
|
|
}
|
|
|
|
|
|
|
|
/* static */ const UnmovableSpec *UnmovableSpec::GetByTile(TileIndex tile)
|
2009-02-07 02:38:32 +00:00
|
|
|
{
|
2010-08-02 20:57:32 +00:00
|
|
|
return UnmovableSpec::Get(GetUnmovableType(tile));
|
2009-02-07 02:38:32 +00:00
|
|
|
}
|
|
|
|
|
2010-08-03 08:58:12 +00:00
|
|
|
void BuildUnmovable(UnmovableType type, TileIndex tile, CompanyID owner, uint index)
|
|
|
|
{
|
|
|
|
const UnmovableSpec *spec = UnmovableSpec::Get(type);
|
|
|
|
|
|
|
|
TileArea ta(tile, GB(spec->size, 0, 4), GB(spec->size, 4, 4));
|
|
|
|
TILE_AREA_LOOP(t, ta) {
|
|
|
|
TileIndex offset = t - tile;
|
|
|
|
MakeUnmovable(t, type, owner, TileY(offset) << 4 | TileX(offset), index);
|
|
|
|
MarkTileDirtyByTile(t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-03 08:32:58 +00:00
|
|
|
/**
|
|
|
|
* Increase the animation stage of a whole structure.
|
|
|
|
* @param northern The northern tile of the structure.
|
|
|
|
* @pre GetUnmovableOffset(northern) == 0
|
|
|
|
*/
|
|
|
|
void IncreaseAnimationStage(TileIndex northern)
|
|
|
|
{
|
|
|
|
assert(GetUnmovableOffset(northern) == 0);
|
|
|
|
const UnmovableSpec *spec = UnmovableSpec::GetByTile(northern);
|
|
|
|
|
|
|
|
TileArea ta(northern, GB(spec->size, 0, 4), GB(spec->size, 4, 4));
|
|
|
|
TILE_AREA_LOOP(t, ta) {
|
|
|
|
SetUnmovableAnimationStage(t, GetUnmovableAnimationStage(t) + 1);
|
|
|
|
MarkTileDirtyByTile(t);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-08-03 08:16:06 +00:00
|
|
|
/** We encode the company HQ size in the animation stage. */
|
|
|
|
#define GetCompanyHQSize GetUnmovableAnimationStage
|
2010-08-03 08:32:58 +00:00
|
|
|
/** We encode the company HQ size in the animation stage. */
|
|
|
|
#define IncreaseCompanyHQSize IncreaseAnimationStage
|
2010-08-03 08:16:06 +00:00
|
|
|
|
2010-08-01 19:22:34 +00:00
|
|
|
/**
|
|
|
|
* Destroy a HQ.
|
2005-05-12 23:46:01 +00:00
|
|
|
* During normal gameplay you can only implicitely destroy a HQ when you are
|
|
|
|
* rebuilding it. Otherwise, only water can destroy it.
|
2008-09-30 20:39:50 +00:00
|
|
|
* @param cid Company requesting the destruction of his HQ
|
2005-05-12 23:46:01 +00:00
|
|
|
* @param flags docommand flags of calling function
|
2007-04-18 00:41:09 +00:00
|
|
|
* @return cost of the operation
|
2005-05-12 23:46:01 +00:00
|
|
|
*/
|
2009-02-09 21:20:05 +00:00
|
|
|
static CommandCost DestroyCompanyHQ(CompanyID cid, DoCommandFlag flags)
|
2005-05-12 23:46:01 +00:00
|
|
|
{
|
2009-05-16 23:34:14 +00:00
|
|
|
Company *c = Company::Get(cid);
|
2005-05-12 23:46:01 +00:00
|
|
|
|
2006-06-24 08:08:28 +00:00
|
|
|
if (flags & DC_EXEC) {
|
2008-09-30 20:39:50 +00:00
|
|
|
TileIndex t = c->location_of_HQ;
|
2006-06-24 08:08:28 +00:00
|
|
|
|
2009-02-05 03:17:30 +00:00
|
|
|
DoClearSquare(t);
|
2006-06-24 08:08:28 +00:00
|
|
|
DoClearSquare(t + TileDiffXY(0, 1));
|
|
|
|
DoClearSquare(t + TileDiffXY(1, 0));
|
|
|
|
DoClearSquare(t + TileDiffXY(1, 1));
|
2009-01-03 17:11:52 +00:00
|
|
|
c->location_of_HQ = INVALID_TILE; // reset HQ position
|
2009-09-13 19:15:59 +00:00
|
|
|
SetWindowDirty(WC_COMPANY, cid);
|
2009-08-08 16:42:55 +00:00
|
|
|
|
|
|
|
CargoPacket::InvalidateAllFrom(ST_HEADQUARTERS, cid);
|
2006-06-24 08:08:28 +00:00
|
|
|
}
|
2005-05-12 23:46:01 +00:00
|
|
|
|
2007-04-04 04:08:47 +00:00
|
|
|
/* cost of relocating company is 1% of company value */
|
2008-09-30 20:39:50 +00:00
|
|
|
return CommandCost(EXPENSES_PROPERTY, CalculateCompanyValue(c) / 100);
|
2005-05-12 23:46:01 +00:00
|
|
|
}
|
|
|
|
|
2010-08-03 12:36:40 +00:00
|
|
|
void UpdateCompanyHQ(TileIndex tile, uint score)
|
2006-03-31 08:59:19 +00:00
|
|
|
{
|
2009-01-03 17:11:52 +00:00
|
|
|
if (tile == INVALID_TILE) return;
|
2006-03-31 08:59:19 +00:00
|
|
|
|
2010-08-03 12:36:40 +00:00
|
|
|
byte val;
|
2006-03-31 09:09:26 +00:00
|
|
|
(val = 0, score < 170) ||
|
|
|
|
(val++, score < 350) ||
|
|
|
|
(val++, score < 520) ||
|
|
|
|
(val++, score < 720) ||
|
|
|
|
(val++, true);
|
2006-03-31 08:59:19 +00:00
|
|
|
|
2010-08-03 08:32:58 +00:00
|
|
|
while (GetCompanyHQSize(tile) < val) {
|
|
|
|
IncreaseCompanyHQSize(tile);
|
|
|
|
}
|
2006-03-31 08:59:19 +00:00
|
|
|
}
|
|
|
|
|
2010-02-20 18:12:56 +00:00
|
|
|
extern CommandCost CheckFlatLand(TileArea tile_area, DoCommandFlag flags);
|
2007-04-04 04:08:47 +00:00
|
|
|
|
2010-08-01 19:22:34 +00:00
|
|
|
/**
|
2010-08-03 12:41:24 +00:00
|
|
|
* Build an unmovable object
|
|
|
|
* @param tile tile where the object will be located
|
2007-04-04 04:08:47 +00:00
|
|
|
* @param flags type of operation
|
2010-08-03 12:41:24 +00:00
|
|
|
* @param p1 the object type to build
|
2005-05-12 23:46:01 +00:00
|
|
|
* @param p2 unused
|
2009-09-18 14:23:58 +00:00
|
|
|
* @param text unused
|
|
|
|
* @return the cost of this operation or an error
|
2005-05-12 23:46:01 +00:00
|
|
|
*/
|
2010-08-03 12:41:24 +00:00
|
|
|
CommandCost CmdBuildUnmovable(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
2005-05-12 23:46:01 +00:00
|
|
|
{
|
2008-01-09 16:55:48 +00:00
|
|
|
CommandCost cost(EXPENSES_PROPERTY);
|
2005-05-12 23:46:01 +00:00
|
|
|
|
2010-08-03 12:41:24 +00:00
|
|
|
UnmovableType type = (UnmovableType)GB(p1, 0, 8);
|
|
|
|
if (type >= UNMOVABLE_MAX) return CMD_ERROR;
|
2005-05-12 23:46:01 +00:00
|
|
|
|
2010-08-03 12:41:24 +00:00
|
|
|
const UnmovableSpec *spec = UnmovableSpec::Get(type);
|
|
|
|
if (spec->flags & OBJECT_FLAG_ONLY_IN_SCENEDIT && _game_mode != GM_EDITOR) return CMD_ERROR;
|
|
|
|
if (spec->flags & OBJECT_FLAG_ONLY_IN_GAME && (_game_mode != GM_NORMAL || _current_company > MAX_COMPANIES)) return CMD_ERROR;
|
2005-05-12 23:46:01 +00:00
|
|
|
|
2010-08-03 12:41:24 +00:00
|
|
|
int size_x = GB(spec->size, 0, 4);
|
|
|
|
int size_y = GB(spec->size, 4, 4);
|
|
|
|
TileArea ta(tile, size_x, size_y);
|
2006-03-31 08:44:53 +00:00
|
|
|
|
2010-08-03 12:41:24 +00:00
|
|
|
if (spec->flags & OBJECT_FLAG_REQUIRE_FLAT) {
|
|
|
|
TILE_AREA_LOOP(tile_cur, ta) {
|
|
|
|
if (GetTileSlope(tile, NULL) != SLOPE_FLAT) return_cmd_error(STR_ERROR_FLAT_LAND_REQUIRED);
|
|
|
|
}
|
2005-05-12 23:46:01 +00:00
|
|
|
}
|
|
|
|
|
2010-08-03 12:41:24 +00:00
|
|
|
/* If we require flat land, we've already tested that.
|
|
|
|
* So we only need to check for clear land. */
|
|
|
|
if (spec->flags & (OBJECT_FLAG_HAS_NO_FOUNDATION | OBJECT_FLAG_REQUIRE_FLAT)) {
|
|
|
|
TILE_AREA_LOOP(tile_cur, ta) {
|
|
|
|
cost.AddCost(DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR));
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
cost.AddCost(CheckFlatLand(ta, flags));
|
2008-01-07 00:45:05 +00:00
|
|
|
}
|
2010-03-14 12:58:51 +00:00
|
|
|
if (cost.Failed()) return cost;
|
2008-01-07 00:45:05 +00:00
|
|
|
|
2010-08-03 12:41:24 +00:00
|
|
|
int hq_score = 0;
|
2010-08-02 22:10:05 +00:00
|
|
|
switch (type) {
|
2010-08-03 12:41:24 +00:00
|
|
|
case UNMOVABLE_OWNED_LAND:
|
|
|
|
if (IsTileType(tile, MP_UNMOVABLE) &&
|
|
|
|
IsTileOwner(tile, _current_company) &&
|
|
|
|
IsOwnedLand(tile)) {
|
|
|
|
return_cmd_error(STR_ERROR_YOU_ALREADY_OWN_IT);
|
|
|
|
}
|
|
|
|
break;
|
2010-08-02 22:10:05 +00:00
|
|
|
|
2010-08-03 12:41:24 +00:00
|
|
|
case UNMOVABLE_HQ: {
|
|
|
|
Company *c = Company::Get(_current_company);
|
|
|
|
if (c->location_of_HQ != INVALID_TILE) { // Moving HQ
|
|
|
|
cost.AddCost(DestroyCompanyHQ(_current_company, flags));
|
|
|
|
}
|
2010-08-02 22:10:05 +00:00
|
|
|
|
|
|
|
if (flags & DC_EXEC) {
|
2010-08-03 12:41:24 +00:00
|
|
|
hq_score = UpdateCompanyRatingAndValue(c, false);
|
|
|
|
c->location_of_HQ = tile;
|
|
|
|
SetWindowDirty(WC_COMPANY, c->index);
|
2010-08-02 22:10:05 +00:00
|
|
|
}
|
|
|
|
break;
|
2010-08-03 12:41:24 +00:00
|
|
|
}
|
2010-08-02 22:10:05 +00:00
|
|
|
|
2010-08-03 12:41:24 +00:00
|
|
|
default: break;
|
|
|
|
}
|
2010-08-02 22:10:05 +00:00
|
|
|
|
2010-08-03 12:41:24 +00:00
|
|
|
if (flags & DC_EXEC) {
|
|
|
|
BuildUnmovable(type, tile);
|
2010-08-02 22:10:05 +00:00
|
|
|
|
2010-08-03 12:41:24 +00:00
|
|
|
/* Make sure the HQ starts at the right size. */
|
|
|
|
if (type == UNMOVABLE_HQ) UpdateCompanyHQ(tile, hq_score);
|
2010-08-02 22:10:05 +00:00
|
|
|
}
|
|
|
|
|
2010-08-03 12:41:24 +00:00
|
|
|
cost.AddCost(UnmovableSpec::Get(type)->GetBuildCost() * size_x * size_y);
|
2010-08-02 22:10:05 +00:00
|
|
|
return cost;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-09-09 11:30:44 +00:00
|
|
|
static Foundation GetFoundation_Unmovable(TileIndex tile, Slope tileh);
|
|
|
|
|
2004-08-09 17:04:08 +00:00
|
|
|
static void DrawTile_Unmovable(TileInfo *ti)
|
|
|
|
{
|
2010-08-03 11:35:57 +00:00
|
|
|
UnmovableType type = GetUnmovableType(ti->tile);
|
2010-08-03 12:07:55 +00:00
|
|
|
const UnmovableSpec *spec = UnmovableSpec::Get(type);
|
|
|
|
if ((spec->flags & OBJECT_FLAG_HAS_NO_FOUNDATION) == 0) DrawFoundation(ti, GetFoundation_Unmovable(ti->tile, ti->tileh));
|
2006-04-03 12:20:55 +00:00
|
|
|
|
2010-08-03 11:35:57 +00:00
|
|
|
const DrawTileSprites *dts = NULL;
|
|
|
|
Owner to = GetTileOwner(ti->tile);
|
|
|
|
PaletteID palette = to == OWNER_NONE ? PAL_NONE : COMPANY_SPRITE_COLOUR(to);
|
2008-04-03 19:55:40 +00:00
|
|
|
|
2010-08-03 11:35:57 +00:00
|
|
|
if (type == UNMOVABLE_HQ) {
|
|
|
|
uint8 offset = GetUnmovableOffset(ti->tile);
|
2010-08-03 11:39:17 +00:00
|
|
|
dts = &_unmovable_hq[GetCompanyHQSize(ti->tile) << 2 | GB(offset, 4, 1) << 1 | GB(offset, 0, 1)];
|
2010-08-03 11:35:57 +00:00
|
|
|
} else {
|
|
|
|
dts = &_unmovables[type];
|
|
|
|
}
|
2008-04-03 19:55:40 +00:00
|
|
|
|
2010-08-03 12:07:55 +00:00
|
|
|
if (spec->flags & OBJECT_FLAG_HAS_NO_FOUNDATION) {
|
|
|
|
/* If an object has no foundation, but tries to draw a (flat) ground
|
|
|
|
* type... we have to be nice and convert that for them. */
|
|
|
|
switch (dts->ground.sprite) {
|
|
|
|
case SPR_FLAT_BARE_LAND: DrawClearLandTile(ti, 0); break;
|
|
|
|
case SPR_FLAT_1_THIRD_GRASS_TILE: DrawClearLandTile(ti, 1); break;
|
|
|
|
case SPR_FLAT_2_THIRD_GRASS_TILE: DrawClearLandTile(ti, 2); break;
|
|
|
|
case SPR_FLAT_GRASS_TILE: DrawClearLandTile(ti, 3); break;
|
|
|
|
default: DrawGroundSprite(dts->ground.sprite, palette); break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
DrawGroundSprite(dts->ground.sprite, palette);
|
|
|
|
}
|
2004-09-10 19:02:27 +00:00
|
|
|
|
2010-08-03 11:35:57 +00:00
|
|
|
if (!IsInvisibilitySet(TO_STRUCTURES)) {
|
|
|
|
const DrawTileSeqStruct *dtss;
|
|
|
|
foreach_draw_tile_seq(dtss, dts->seq) {
|
2004-08-09 17:04:08 +00:00
|
|
|
AddSortableSpriteToDraw(
|
2010-08-03 11:35:57 +00:00
|
|
|
dtss->image.sprite, palette,
|
|
|
|
ti->x + dtss->delta_x, ti->y + dtss->delta_y,
|
|
|
|
dtss->size_x, dtss->size_y,
|
|
|
|
dtss->size_z, ti->z + dtss->delta_z,
|
|
|
|
IsTransparencySet(TO_STRUCTURES)
|
2004-08-09 17:04:08 +00:00
|
|
|
);
|
2006-06-27 21:25:53 +00:00
|
|
|
}
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
2010-08-03 11:35:57 +00:00
|
|
|
|
2010-08-03 12:07:55 +00:00
|
|
|
if (spec->flags & OBJECT_FLAG_ALLOW_UNDER_BRIDGE) DrawBridgeMiddle(ti);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2006-08-06 16:32:49 +00:00
|
|
|
static uint GetSlopeZ_Unmovable(TileIndex tile, uint x, uint y)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2006-08-06 16:32:49 +00:00
|
|
|
if (IsOwnedLand(tile)) {
|
|
|
|
uint z;
|
2007-01-10 18:56:51 +00:00
|
|
|
Slope tileh = GetTileSlope(tile, &z);
|
2006-08-06 16:32:49 +00:00
|
|
|
|
|
|
|
return z + GetPartialZ(x & 0xF, y & 0xF, tileh);
|
2006-03-21 20:02:05 +00:00
|
|
|
} else {
|
2006-08-06 16:32:49 +00:00
|
|
|
return GetTileMaxZ(tile);
|
2006-03-21 20:02:05 +00:00
|
|
|
}
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2007-07-26 16:51:10 +00:00
|
|
|
static Foundation GetFoundation_Unmovable(TileIndex tile, Slope tileh)
|
2004-08-13 18:27:33 +00:00
|
|
|
{
|
2007-07-26 16:51:10 +00:00
|
|
|
return IsOwnedLand(tile) ? FOUNDATION_NONE : FlatteningFoundation(tileh);
|
2004-08-13 18:27:33 +00:00
|
|
|
}
|
|
|
|
|
2009-02-09 21:20:05 +00:00
|
|
|
static CommandCost ClearTile_Unmovable(TileIndex tile, DoCommandFlag flags)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2010-08-02 23:05:54 +00:00
|
|
|
UnmovableType type = GetUnmovableType(tile);
|
|
|
|
const UnmovableSpec *spec = UnmovableSpec::Get(type);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2010-08-02 22:03:28 +00:00
|
|
|
/* Water can remove everything! */
|
|
|
|
if (_current_company != OWNER_WATER) {
|
2010-08-02 23:05:54 +00:00
|
|
|
if (type != UNMOVABLE_OWNED_LAND && flags & DC_AUTO) {
|
2010-08-02 22:03:28 +00:00
|
|
|
/* No automatic removal by overbuilding stuff. */
|
2010-08-02 23:05:54 +00:00
|
|
|
return_cmd_error(type == UNMOVABLE_HQ ? STR_ERROR_COMPANY_HEADQUARTERS_IN : STR_ERROR_OBJECT_IN_THE_WAY);
|
|
|
|
} else if (_game_mode == GM_EDITOR) {
|
|
|
|
/* No further limitations for the editor. */
|
|
|
|
} else if (GetTileOwner(tile) == OWNER_NONE) {
|
|
|
|
/* Owned by nobody, so we can only remove it with brute force! */
|
|
|
|
if (!_cheats.magic_bulldozer.value) return CMD_ERROR;
|
|
|
|
} else if (CheckTileOwnership(tile).Failed()) {
|
|
|
|
/* We don't own it!. */
|
|
|
|
return_cmd_error(STR_ERROR_OWNED_BY);
|
|
|
|
} else if (type != UNMOVABLE_OWNED_LAND && !_cheats.magic_bulldozer.value) {
|
2010-08-02 22:03:28 +00:00
|
|
|
/* In the game editor or with cheats we can remove, otherwise we can't. */
|
|
|
|
return CMD_ERROR;
|
|
|
|
}
|
2010-07-24 10:14:39 +00:00
|
|
|
}
|
2004-09-10 19:02:27 +00:00
|
|
|
|
2010-08-02 23:05:54 +00:00
|
|
|
switch (type) {
|
|
|
|
case UNMOVABLE_HQ:
|
|
|
|
return DestroyCompanyHQ(GetTileOwner(tile), flags);
|
2008-01-31 21:16:40 +00:00
|
|
|
|
2010-08-02 23:05:54 +00:00
|
|
|
case UNMOVABLE_STATUE:
|
|
|
|
if (flags & DC_EXEC) {
|
|
|
|
TownID town = GetStatueTownID(tile);
|
|
|
|
ClrBit(Town::Get(town)->statues, GetTileOwner(tile));
|
|
|
|
SetWindowDirty(WC_TOWN_AUTHORITY, town);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2007-03-08 14:34:32 +00:00
|
|
|
}
|
|
|
|
|
2004-09-10 19:02:27 +00:00
|
|
|
if (flags & DC_EXEC) {
|
2004-08-09 17:04:08 +00:00
|
|
|
DoClearSquare(tile);
|
|
|
|
}
|
|
|
|
|
2010-08-02 23:05:54 +00:00
|
|
|
CommandCost cost(EXPENSES_CONSTRUCTION, spec->GetClearCost());
|
|
|
|
if (type == UNMOVABLE_OWNED_LAND) cost.MultiplyCost(-1); // They get an income!
|
|
|
|
return cost;
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2009-09-20 17:44:33 +00:00
|
|
|
static void AddAcceptedCargo_Unmovable(TileIndex tile, CargoArray &acceptance, uint32 *always_accepted)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2006-04-03 12:20:55 +00:00
|
|
|
if (!IsCompanyHQ(tile)) return;
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
/* HQ accepts passenger and mail; but we have to divide the values
|
|
|
|
* between 4 tiles it occupies! */
|
|
|
|
|
2008-04-25 15:25:28 +00:00
|
|
|
/* HQ level (depends on company performance) in the range 1..5. */
|
|
|
|
uint level = GetCompanyHQSize(tile) + 1;
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2007-04-04 04:08:47 +00:00
|
|
|
/* Top town building generates 10, so to make HQ interesting, the top
|
|
|
|
* type makes 20. */
|
2009-06-27 18:26:50 +00:00
|
|
|
acceptance[CT_PASSENGERS] += max(1U, level);
|
2009-09-20 17:44:33 +00:00
|
|
|
SetBit(*always_accepted, CT_PASSENGERS);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2007-04-04 04:08:47 +00:00
|
|
|
/* Top town building generates 4, HQ can make up to 8. The
|
|
|
|
* proportion passengers:mail is different because such a huge
|
|
|
|
* commercial building generates unusually high amount of mail
|
|
|
|
* correspondence per physical visitor. */
|
2009-06-27 18:26:50 +00:00
|
|
|
acceptance[CT_MAIL] += max(1U, level / 2);
|
2009-09-20 17:44:33 +00:00
|
|
|
SetBit(*always_accepted, CT_MAIL);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-06-24 12:38:35 +00:00
|
|
|
static void GetTileDesc_Unmovable(TileIndex tile, TileDesc *td)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2010-08-02 20:57:32 +00:00
|
|
|
td->str = UnmovableSpec::GetByTile(tile)->name;
|
2008-05-21 22:15:39 +00:00
|
|
|
td->owner[0] = GetTileOwner(tile);
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2005-06-24 12:38:35 +00:00
|
|
|
static void TileLoop_Unmovable(TileIndex tile)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2006-04-03 12:20:55 +00:00
|
|
|
if (!IsCompanyHQ(tile)) return;
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
/* HQ accepts passenger and mail; but we have to divide the values
|
|
|
|
* between 4 tiles it occupies! */
|
|
|
|
|
2008-04-25 15:25:28 +00:00
|
|
|
/* HQ level (depends on company performance) in the range 1..5. */
|
|
|
|
uint level = GetCompanyHQSize(tile) + 1;
|
2004-08-09 17:04:08 +00:00
|
|
|
assert(level < 6);
|
|
|
|
|
2010-01-04 18:12:10 +00:00
|
|
|
StationFinder stations(TileArea(tile, 2, 2));
|
2009-11-15 21:06:13 +00:00
|
|
|
|
2008-04-25 15:25:28 +00:00
|
|
|
uint r = Random();
|
2007-04-04 04:08:47 +00:00
|
|
|
/* Top town buildings generate 250, so the top HQ type makes 256. */
|
2005-07-21 06:31:02 +00:00
|
|
|
if (GB(r, 0, 8) < (256 / 4 / (6 - level))) {
|
|
|
|
uint amt = GB(r, 0, 8) / 8 / 4 + 1;
|
2004-08-09 17:04:08 +00:00
|
|
|
if (_economy.fluct <= 0) amt = (amt + 1) >> 1;
|
2009-11-15 21:06:13 +00:00
|
|
|
MoveGoodsToStation(CT_PASSENGERS, amt, ST_HEADQUARTERS, GetTileOwner(tile), stations.GetStations());
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2007-04-04 04:08:47 +00:00
|
|
|
/* Top town building generates 90, HQ can make up to 196. The
|
|
|
|
* proportion passengers:mail is about the same as in the acceptance
|
|
|
|
* equations. */
|
2005-07-21 06:31:02 +00:00
|
|
|
if (GB(r, 8, 8) < (196 / 4 / (6 - level))) {
|
|
|
|
uint amt = GB(r, 8, 8) / 8 / 4 + 1;
|
2004-08-09 17:04:08 +00:00
|
|
|
if (_economy.fluct <= 0) amt = (amt + 1) >> 1;
|
2009-11-15 21:06:13 +00:00
|
|
|
MoveGoodsToStation(CT_MAIL, amt, ST_HEADQUARTERS, GetTileOwner(tile), stations.GetStations());
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-02-20 17:49:50 +00:00
|
|
|
static TrackStatus GetTileTrackStatus_Unmovable(TileIndex tile, TransportType mode, uint sub_mode, DiagDirection side)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-01-02 22:42:05 +00:00
|
|
|
static bool ClickTile_Unmovable(TileIndex tile)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2009-01-02 22:42:05 +00:00
|
|
|
if (!IsCompanyHQ(tile)) return false;
|
|
|
|
|
|
|
|
ShowCompany(GetTileOwner(tile));
|
|
|
|
return true;
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* checks, if a radio tower is within a 9x9 tile square around tile */
|
2006-06-28 06:17:41 +00:00
|
|
|
static bool IsRadioTowerNearby(TileIndex tile)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2009-01-21 02:31:55 +00:00
|
|
|
TileIndex tile_s = tile - TileDiffXY(min(TileX(tile), 4U), min(TileY(tile), 4U));
|
|
|
|
uint w = min(TileX(tile), 4U) + 1 + min(MapMaxX() - TileX(tile), 4U);
|
|
|
|
uint h = min(TileY(tile), 4U) + 1 + min(MapMaxY() - TileY(tile), 4U);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2009-07-26 21:50:30 +00:00
|
|
|
TILE_LOOP(tile, w, h, tile_s) {
|
2006-06-28 06:17:41 +00:00
|
|
|
if (IsTransmitterTile(tile)) return true;
|
2009-07-26 21:50:30 +00:00
|
|
|
}
|
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
- New optional landscape generator (TerraGenesis Perlin)
- Load heightmaps (either BMP or PNG)
- Progress dialog while generating worlds (no longer a 'hanging' screen)
- New dialogs for NewGame, Create Scenario and Play Heightmap
- Easier to configure your landscape
- More things to configure (tree-placer, ..)
- Speedup of world generation
- New console command 'restart': restart the map EXACTLY as it was when you
first started it (needs a game made after or with this commit)
- New console command 'getseed': get the seed of your map and share it with
others (of course only works with generated maps)
- Many new, world generation related, things
- Many internal cleanups and rewrites
Many tnx to those people who helped making this:
Belugas, DaleStan, glx, KUDr, RichK67, Rubidium, and TrueLight (alfabetic)
Many tnx to those who helped testing:
Arnau, Bjarni, and tokai (alfabetic)
And to all other people who helped testing and sending comments / bugs
Stats: 673 lines changed, 3534 new lines, 79 new strings
2006-08-19 10:00:30 +00:00
|
|
|
|
2006-06-28 06:17:41 +00:00
|
|
|
return false;
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2007-03-07 11:47:46 +00:00
|
|
|
void GenerateUnmovables()
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2008-05-29 15:13:28 +00:00
|
|
|
if (_settings_game.game_creation.landscape == LT_TOYLAND) return;
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
/* add radio tower */
|
2009-02-07 03:06:38 +00:00
|
|
|
int radiotower_to_build = ScaleByMapSize(15); // maximum number of radio towers on the map
|
2008-05-29 15:13:28 +00:00
|
|
|
int lighthouses_to_build = _settings_game.game_creation.landscape == LT_TROPIC ? 0 : ScaleByMapSize1D((Random() & 3) + 7);
|
2009-01-21 02:31:55 +00:00
|
|
|
|
|
|
|
/* Scale the amount of lighthouses with the amount of land at the borders. */
|
2009-02-10 00:50:04 +00:00
|
|
|
if (_settings_game.construction.freeform_edges && lighthouses_to_build != 0) {
|
2009-01-21 02:31:55 +00:00
|
|
|
uint num_water_tiles = 0;
|
|
|
|
for (uint x = 0; x < MapMaxX(); x++) {
|
|
|
|
if (IsTileType(TileXY(x, 1), MP_WATER)) num_water_tiles++;
|
|
|
|
if (IsTileType(TileXY(x, MapMaxY() - 1), MP_WATER)) num_water_tiles++;
|
|
|
|
}
|
|
|
|
for (uint y = 1; y < MapMaxY() - 1; y++) {
|
|
|
|
if (IsTileType(TileXY(1, y), MP_WATER)) num_water_tiles++;
|
|
|
|
if (IsTileType(TileXY(MapMaxX() - 1, y), MP_WATER)) num_water_tiles++;
|
|
|
|
}
|
|
|
|
/* The -6 is because the top borders are MP_VOID (-2) and all corners
|
|
|
|
* are counted twice (-4). */
|
|
|
|
lighthouses_to_build = lighthouses_to_build * num_water_tiles / (2 * MapMaxY() + 2 * MapMaxX() - 6);
|
|
|
|
}
|
|
|
|
|
2009-02-07 03:06:38 +00:00
|
|
|
SetGeneratingWorldProgress(GWP_UNMOVABLE, radiotower_to_build + lighthouses_to_build);
|
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
- New optional landscape generator (TerraGenesis Perlin)
- Load heightmaps (either BMP or PNG)
- Progress dialog while generating worlds (no longer a 'hanging' screen)
- New dialogs for NewGame, Create Scenario and Play Heightmap
- Easier to configure your landscape
- More things to configure (tree-placer, ..)
- Speedup of world generation
- New console command 'restart': restart the map EXACTLY as it was when you
first started it (needs a game made after or with this commit)
- New console command 'getseed': get the seed of your map and share it with
others (of course only works with generated maps)
- Many new, world generation related, things
- Many internal cleanups and rewrites
Many tnx to those people who helped making this:
Belugas, DaleStan, glx, KUDr, RichK67, Rubidium, and TrueLight (alfabetic)
Many tnx to those who helped testing:
Arnau, Bjarni, and tokai (alfabetic)
And to all other people who helped testing and sending comments / bugs
Stats: 673 lines changed, 3534 new lines, 79 new strings
2006-08-19 10:00:30 +00:00
|
|
|
|
2008-04-25 15:25:28 +00:00
|
|
|
for (uint i = ScaleByMapSize(1000); i != 0; i--) {
|
|
|
|
TileIndex tile = RandomTile();
|
|
|
|
|
|
|
|
uint h;
|
2007-07-08 18:40:15 +00:00
|
|
|
if (IsTileType(tile, MP_CLEAR) && GetTileSlope(tile, &h) == SLOPE_FLAT && h >= TILE_HEIGHT * 4 && !IsBridgeAbove(tile)) {
|
2006-06-28 06:17:41 +00:00
|
|
|
if (IsRadioTowerNearby(tile)) continue;
|
2008-04-25 15:25:28 +00:00
|
|
|
|
2010-08-03 08:58:12 +00:00
|
|
|
BuildUnmovable(UNMOVABLE_TRANSMITTER, tile);
|
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
- New optional landscape generator (TerraGenesis Perlin)
- Load heightmaps (either BMP or PNG)
- Progress dialog while generating worlds (no longer a 'hanging' screen)
- New dialogs for NewGame, Create Scenario and Play Heightmap
- Easier to configure your landscape
- More things to configure (tree-placer, ..)
- Speedup of world generation
- New console command 'restart': restart the map EXACTLY as it was when you
first started it (needs a game made after or with this commit)
- New console command 'getseed': get the seed of your map and share it with
others (of course only works with generated maps)
- Many new, world generation related, things
- Many internal cleanups and rewrites
Many tnx to those people who helped making this:
Belugas, DaleStan, glx, KUDr, RichK67, Rubidium, and TrueLight (alfabetic)
Many tnx to those who helped testing:
Arnau, Bjarni, and tokai (alfabetic)
And to all other people who helped testing and sending comments / bugs
Stats: 673 lines changed, 3534 new lines, 79 new strings
2006-08-19 10:00:30 +00:00
|
|
|
IncreaseGeneratingWorldProgress(GWP_UNMOVABLE);
|
2009-02-07 03:06:38 +00:00
|
|
|
if (--radiotower_to_build == 0) break;
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
2008-04-25 15:25:28 +00:00
|
|
|
}
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
/* add lighthouses */
|
2008-04-25 15:25:28 +00:00
|
|
|
uint maxx = MapMaxX();
|
|
|
|
uint maxy = MapMaxY();
|
|
|
|
for (int loop_count = 0; loop_count < 1000 && lighthouses_to_build != 0; loop_count++) {
|
|
|
|
uint r = Random();
|
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
- New optional landscape generator (TerraGenesis Perlin)
- Load heightmaps (either BMP or PNG)
- Progress dialog while generating worlds (no longer a 'hanging' screen)
- New dialogs for NewGame, Create Scenario and Play Heightmap
- Easier to configure your landscape
- More things to configure (tree-placer, ..)
- Speedup of world generation
- New console command 'restart': restart the map EXACTLY as it was when you
first started it (needs a game made after or with this commit)
- New console command 'getseed': get the seed of your map and share it with
others (of course only works with generated maps)
- Many new, world generation related, things
- Many internal cleanups and rewrites
Many tnx to those people who helped making this:
Belugas, DaleStan, glx, KUDr, RichK67, Rubidium, and TrueLight (alfabetic)
Many tnx to those who helped testing:
Arnau, Bjarni, and tokai (alfabetic)
And to all other people who helped testing and sending comments / bugs
Stats: 673 lines changed, 3534 new lines, 79 new strings
2006-08-19 10:00:30 +00:00
|
|
|
|
|
|
|
/* Scatter the lighthouses more evenly around the perimeter */
|
2008-04-25 15:25:28 +00:00
|
|
|
int perimeter = (GB(r, 16, 16) % (2 * (maxx + maxy))) - maxy;
|
|
|
|
DiagDirection dir;
|
(svn r5946) -Add: merged the TGP branch to mainline. TGP adds:
- New optional landscape generator (TerraGenesis Perlin)
- Load heightmaps (either BMP or PNG)
- Progress dialog while generating worlds (no longer a 'hanging' screen)
- New dialogs for NewGame, Create Scenario and Play Heightmap
- Easier to configure your landscape
- More things to configure (tree-placer, ..)
- Speedup of world generation
- New console command 'restart': restart the map EXACTLY as it was when you
first started it (needs a game made after or with this commit)
- New console command 'getseed': get the seed of your map and share it with
others (of course only works with generated maps)
- Many new, world generation related, things
- Many internal cleanups and rewrites
Many tnx to those people who helped making this:
Belugas, DaleStan, glx, KUDr, RichK67, Rubidium, and TrueLight (alfabetic)
Many tnx to those who helped testing:
Arnau, Bjarni, and tokai (alfabetic)
And to all other people who helped testing and sending comments / bugs
Stats: 673 lines changed, 3534 new lines, 79 new strings
2006-08-19 10:00:30 +00:00
|
|
|
for (dir = DIAGDIR_NE; perimeter > 0; dir++) {
|
|
|
|
perimeter -= (DiagDirToAxis(dir) == AXIS_X) ? maxx : maxy;
|
|
|
|
}
|
|
|
|
|
2008-04-25 15:25:28 +00:00
|
|
|
TileIndex tile;
|
2006-03-08 12:26:56 +00:00
|
|
|
switch (dir) {
|
|
|
|
default:
|
2009-01-21 02:31:55 +00:00
|
|
|
case DIAGDIR_NE: tile = TileXY(maxx - 1, r % maxy); break;
|
|
|
|
case DIAGDIR_SE: tile = TileXY(r % maxx, 1); break;
|
|
|
|
case DIAGDIR_SW: tile = TileXY(1, r % maxy); break;
|
|
|
|
case DIAGDIR_NW: tile = TileXY(r % maxx, maxy - 1); break;
|
2006-03-08 12:26:56 +00:00
|
|
|
}
|
2004-08-09 17:04:08 +00:00
|
|
|
|
2009-01-21 02:31:55 +00:00
|
|
|
/* Only build lighthouses at tiles where the border is sea. */
|
|
|
|
if (!IsTileType(tile, MP_WATER)) continue;
|
|
|
|
|
|
|
|
for (int j = 0; j < 19; j++) {
|
2008-04-25 15:25:28 +00:00
|
|
|
uint h;
|
|
|
|
if (IsTileType(tile, MP_CLEAR) && GetTileSlope(tile, &h) == SLOPE_FLAT && h <= TILE_HEIGHT * 2 && !IsBridgeAbove(tile)) {
|
2010-08-03 08:58:12 +00:00
|
|
|
BuildUnmovable(UNMOVABLE_LIGHTHOUSE, tile);
|
2008-04-25 15:25:28 +00:00
|
|
|
IncreaseGeneratingWorldProgress(GWP_UNMOVABLE);
|
|
|
|
lighthouses_to_build--;
|
2009-02-25 21:50:54 +00:00
|
|
|
assert(tile < MapSize());
|
2008-04-25 15:25:28 +00:00
|
|
|
break;
|
|
|
|
}
|
2009-02-25 21:29:50 +00:00
|
|
|
tile = AddTileIndexDiffCWrap(tile, TileIndexDiffCByDiagDir(dir));
|
|
|
|
if (tile == INVALID_TILE) break;
|
2008-04-25 15:25:28 +00:00
|
|
|
}
|
|
|
|
}
|
2004-08-09 17:04:08 +00:00
|
|
|
}
|
|
|
|
|
2008-09-30 20:39:50 +00:00
|
|
|
static void ChangeTileOwner_Unmovable(TileIndex tile, Owner old_owner, Owner new_owner)
|
2004-08-09 17:04:08 +00:00
|
|
|
{
|
2008-09-30 20:39:50 +00:00
|
|
|
if (!IsTileOwner(tile, old_owner)) return;
|
2004-09-10 19:02:27 +00:00
|
|
|
|
2008-09-30 20:39:50 +00:00
|
|
|
if (IsOwnedLand(tile) && new_owner != INVALID_OWNER) {
|
|
|
|
SetTileOwner(tile, new_owner);
|
2008-02-01 22:13:59 +00:00
|
|
|
} else if (IsStatueTile(tile)) {
|
|
|
|
TownID town = GetStatueTownID(tile);
|
2009-05-16 23:34:14 +00:00
|
|
|
Town *t = Town::Get(town);
|
2008-09-30 20:39:50 +00:00
|
|
|
ClrBit(t->statues, old_owner);
|
|
|
|
if (new_owner != INVALID_OWNER && !HasBit(t->statues, new_owner)) {
|
2008-02-01 22:13:59 +00:00
|
|
|
/* Transfer ownership to the new company */
|
2008-09-30 20:39:50 +00:00
|
|
|
SetBit(t->statues, new_owner);
|
|
|
|
SetTileOwner(tile, new_owner);
|
2008-02-01 22:13:59 +00:00
|
|
|
} else {
|
|
|
|
DoClearSquare(tile);
|
|
|
|
}
|
|
|
|
|
2009-09-13 19:15:59 +00:00
|
|
|
SetWindowDirty(WC_TOWN_AUTHORITY, town);
|
2005-07-08 22:25:24 +00:00
|
|
|
} else {
|
2004-08-09 17:04:08 +00:00
|
|
|
DoClearSquare(tile);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-02-09 21:20:05 +00:00
|
|
|
static CommandCost TerraformTile_Unmovable(TileIndex tile, DoCommandFlag flags, uint z_new, Slope tileh_new)
|
2007-08-30 17:17:04 +00:00
|
|
|
{
|
2010-08-03 12:07:55 +00:00
|
|
|
UnmovableType type = GetUnmovableType(tile);
|
|
|
|
const UnmovableSpec *spec = UnmovableSpec::Get(type);
|
|
|
|
|
|
|
|
if (spec->flags & OBJECT_FLAG_REQUIRE_FLAT) {
|
|
|
|
/* If a flat tile is required by the object, then terraforming is never good. */
|
|
|
|
return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
|
|
|
|
}
|
|
|
|
|
2010-03-07 20:44:05 +00:00
|
|
|
if (IsOwnedLand(tile)) {
|
2010-08-03 12:07:55 +00:00
|
|
|
/* Owned land remains unsold */
|
2010-03-07 20:44:05 +00:00
|
|
|
CommandCost ret = CheckTileOwnership(tile);
|
|
|
|
if (ret.Succeeded()) return CommandCost();
|
2010-08-03 12:07:55 +00:00
|
|
|
} else if (AutoslopeEnabled()) {
|
2009-11-24 22:15:42 +00:00
|
|
|
if (!IsSteepSlope(tileh_new) && (z_new + GetSlopeMaxZ(tileh_new) == GetTileMaxZ(tile))) return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_BUILD_FOUNDATION]);
|
2007-09-14 22:27:40 +00:00
|
|
|
}
|
|
|
|
|
2007-08-30 17:17:04 +00:00
|
|
|
return DoCommand(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR);
|
|
|
|
}
|
|
|
|
|
2007-01-10 18:56:51 +00:00
|
|
|
extern const TileTypeProcs _tile_type_unmovable_procs = {
|
2009-03-15 00:32:18 +00:00
|
|
|
DrawTile_Unmovable, // draw_tile_proc
|
|
|
|
GetSlopeZ_Unmovable, // get_slope_z_proc
|
|
|
|
ClearTile_Unmovable, // clear_tile_proc
|
2009-06-25 19:23:09 +00:00
|
|
|
AddAcceptedCargo_Unmovable, // add_accepted_cargo_proc
|
2009-03-15 00:32:18 +00:00
|
|
|
GetTileDesc_Unmovable, // get_tile_desc_proc
|
|
|
|
GetTileTrackStatus_Unmovable, // get_tile_track_status_proc
|
|
|
|
ClickTile_Unmovable, // click_tile_proc
|
2009-06-25 20:08:59 +00:00
|
|
|
NULL, // animate_tile_proc
|
2009-03-15 00:32:18 +00:00
|
|
|
TileLoop_Unmovable, // tile_loop_clear
|
|
|
|
ChangeTileOwner_Unmovable, // change_tile_owner_clear
|
2009-06-27 17:05:20 +00:00
|
|
|
NULL, // add_produced_cargo_proc
|
2009-03-15 00:32:18 +00:00
|
|
|
NULL, // vehicle_enter_tile_proc
|
|
|
|
GetFoundation_Unmovable, // get_foundation_proc
|
|
|
|
TerraformTile_Unmovable, // terraform_tile_proc
|
2004-08-09 17:04:08 +00:00
|
|
|
};
|