unmovable_cmd.c
author tron
Wed, 13 Jul 2005 18:04:01 +0000
changeset 2049 ad0d49c916d4
parent 2026 02dfa0aa2c2f
child 2051 44b6b091beb3
permissions -rw-r--r--
(svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     1
#include "stdafx.h"
1891
92a3b0aa0946 (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents: 1796
diff changeset
     2
#include "openttd.h"
507
8aa8100b0b22 (svn r815) Include strings.h only in the files which need it.
tron
parents: 497
diff changeset
     3
#include "table/strings.h"
679
e959706a3e4d (svn r1117) Move map arrays and some related macros into their own files map.c and map.h
tron
parents: 507
diff changeset
     4
#include "map.h"
1209
a1ac96655b79 (svn r1713) Split off several functions which query/set information about a single tile from map.h and put them into a seperate file tile.h
tron
parents: 1202
diff changeset
     5
#include "tile.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     6
#include "command.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     7
#include "viewport.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     8
#include "player.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     9
#include "gui.h"
384
bf1303e754ff (svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents: 222
diff changeset
    10
#include "station.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    11
#include "economy.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    12
#include "town.h"
405
6830ae7a0d5d (svn r602) -newgrf: Move DrawTileSeqStruct & co and struct SpriteGroup to sprite.h (pasky)
darkvater
parents: 384
diff changeset
    13
#include "sprite.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    14
1796
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    15
/** Destroy a HQ.
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    16
 * During normal gameplay you can only implicitely destroy a HQ when you are
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    17
 * rebuilding it. Otherwise, only water can destroy it.
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    18
 * @param tile tile coordinates where HQ is located to destroy
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    19
 * @param flags docommand flags of calling function
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    20
 */
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    21
int32 DestroyCompanyHQ(TileIndex tile, uint32 flags)
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    22
{
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    23
	Player *p;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    24
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    25
	SET_EXPENSES_TYPE(EXPENSES_PROPERTY);
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    26
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    27
	/* Find player that has HQ flooded, and reset their location_of_house */
2026
02dfa0aa2c2f (svn r2535) Tabs
tron
parents: 1981
diff changeset
    28
	if (_current_player == OWNER_WATER) {
1796
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    29
		bool dodelete = false;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    30
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    31
		FOR_ALL_PLAYERS(p) {
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    32
			if (p->location_of_house == tile) {
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    33
				dodelete = true;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    34
				break;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    35
			}
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    36
		}
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    37
		if (!dodelete) return CMD_ERROR;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    38
	} else /* Destruction was initiated by player */
1962
51ee4f459268 (svn r2468) -Codechange: Got rid of DEREF_PLAYER and replaced it by GetPlayer
celestar
parents: 1902
diff changeset
    39
		p = GetPlayer(_current_player);
1796
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    40
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    41
		if (p->location_of_house == 0) return CMD_ERROR;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    42
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    43
		if (flags & DC_EXEC) {
1981
de031d2aed47 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY
tron
parents: 1980
diff changeset
    44
			DoClearSquare(p->location_of_house + TileDiffXY(0, 0));
de031d2aed47 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY
tron
parents: 1980
diff changeset
    45
			DoClearSquare(p->location_of_house + TileDiffXY(0, 1));
de031d2aed47 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY
tron
parents: 1980
diff changeset
    46
			DoClearSquare(p->location_of_house + TileDiffXY(1, 0));
de031d2aed47 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY
tron
parents: 1980
diff changeset
    47
			DoClearSquare(p->location_of_house + TileDiffXY(1, 1));
1796
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    48
			p->location_of_house = 0; // reset HQ position
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    49
			InvalidateWindow(WC_COMPANY, (int)p->index);
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    50
		}
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    51
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    52
	// cost of relocating company is 1% of company value
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    53
		return CalculateCompanyValue(p) / 100;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    54
}
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    55
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    56
/** Build or relocate the HQ. This depends if the HQ is already built or not
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    57
 * @param x,y the coordinates where the HQ will be built or relocated to
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    58
 * @param p1 relocate HQ (set to some value, usually 1 or true)
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    59
 * @param p2 unused
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    60
 */
1977
4392ae3d8e31 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1962
diff changeset
    61
extern int32 CheckFlatLandBelow(TileIndex tile, uint w, uint h, uint flags, uint invalid_dirs, int *);
1796
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    62
int32 CmdBuildCompanyHQ(int x, int y, uint32 flags, uint32 p1, uint32 p2)
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    63
{
1980
9ea0c89fbb58 (svn r2486) Turn TILE_FROM_XY into an inline function and rename it to TileVirtXY
tron
parents: 1977
diff changeset
    64
	TileIndex tile = TileVirtXY(x, y);
1962
51ee4f459268 (svn r2468) -Codechange: Got rid of DEREF_PLAYER and replaced it by GetPlayer
celestar
parents: 1902
diff changeset
    65
	Player *p = GetPlayer(_current_player);
1796
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    66
	int cost;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    67
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    68
	SET_EXPENSES_TYPE(EXPENSES_PROPERTY);
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    69
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    70
	cost = CheckFlatLandBelow(tile, 2, 2, flags, 0, NULL);
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    71
	if (CmdFailed(cost)) return CMD_ERROR;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    72
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    73
	if (p1) { /* Moving HQ */
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    74
		int32 ret;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    75
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    76
		if (p->location_of_house == 0) return CMD_ERROR;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    77
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    78
		ret = DestroyCompanyHQ(p->location_of_house, flags);
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    79
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    80
		if (CmdFailed(ret)) return CMD_ERROR;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    81
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    82
		cost += ret;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    83
	} else { /* Building new HQ */
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    84
		if (p->location_of_house != 0) return CMD_ERROR;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    85
	}
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    86
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    87
	if (flags & DC_EXEC) {
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    88
		int score = UpdateCompanyRatingAndValue(p, false);
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    89
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    90
		p->location_of_house = tile;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    91
1981
de031d2aed47 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY
tron
parents: 1980
diff changeset
    92
		ModifyTile(tile + TileDiffXY(0, 0), MP_SETTYPE(MP_UNMOVABLE) | MP_MAPOWNER_CURRENT | MP_MAP5, 0x80);
de031d2aed47 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY
tron
parents: 1980
diff changeset
    93
		ModifyTile(tile + TileDiffXY(0, 1), MP_SETTYPE(MP_UNMOVABLE) | MP_MAPOWNER_CURRENT | MP_MAP5, 0x81);
de031d2aed47 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY
tron
parents: 1980
diff changeset
    94
		ModifyTile(tile + TileDiffXY(1, 0), MP_SETTYPE(MP_UNMOVABLE) | MP_MAPOWNER_CURRENT | MP_MAP5, 0x82);
de031d2aed47 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY
tron
parents: 1980
diff changeset
    95
		ModifyTile(tile + TileDiffXY(1, 1), MP_SETTYPE(MP_UNMOVABLE) | MP_MAPOWNER_CURRENT | MP_MAP5, 0x83);
1796
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    96
		UpdatePlayerHouse(p, score);
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    97
		InvalidateWindow(WC_COMPANY, (int)p->index);
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    98
	}
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
    99
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
   100
	return cost;
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
   101
}
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
   102
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   103
typedef struct DrawTileUnmovableStruct {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   104
	uint16 image;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   105
	byte subcoord_x;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   106
	byte subcoord_y;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   107
	byte width;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   108
	byte height;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   109
	byte z_size;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   110
	byte unused;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   111
} DrawTileUnmovableStruct;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   112
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   113
#include "table/unmovable_land.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   114
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   115
static void DrawTile_Unmovable(TileInfo *ti)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   116
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   117
	uint32 image, ormod;
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   118
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   119
	if (!(ti->map5 & 0x80)) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   120
		if (ti->map5 == 2) {
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   121
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   122
			// statue
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   123
			DrawGroundSprite(0x58C);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   124
1901
fb05044cf5c3 (svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner
tron
parents: 1891
diff changeset
   125
			image = PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   126
			image += 0x8A48;
497
2d6d31173813 (svn r787) Invert the sense of the DO_TRANS_BUILDINGS flag to be consistent with its own name and all other DO_* flags.
tron
parents: 473
diff changeset
   127
			if (_display_opt & DO_TRANS_BUILDINGS)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   128
				image = (image & 0x3FFF) | 0x3224000;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   129
			AddSortableSpriteToDraw(image, ti->x, ti->y, 16, 16, 25, ti->z);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   130
		} else if (ti->map5 == 3) {
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   131
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   132
			// "owned by" sign
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   133
			DrawClearLandTile(ti, 0);
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   134
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   135
			AddSortableSpriteToDraw(
1901
fb05044cf5c3 (svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner
tron
parents: 1891
diff changeset
   136
				PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile)) + 0x92B6,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   137
				ti->x+8, ti->y+8,
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   138
				1, 1,
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   139
				10,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   140
				GetSlopeZ(ti->x+8, ti->y+8)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   141
			);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   142
		} else {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   143
			// lighthouse or transmitter
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   144
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   145
			const DrawTileUnmovableStruct *dtus;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   146
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   147
			if (ti->tileh) DrawFoundation(ti, ti->tileh);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   148
			DrawClearLandTile(ti, 2);
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   149
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   150
			dtus = &_draw_tile_unmovable_data[ti->map5];
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   151
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   152
			image = dtus->image;
497
2d6d31173813 (svn r787) Invert the sense of the DO_TRANS_BUILDINGS flag to be consistent with its own name and all other DO_* flags.
tron
parents: 473
diff changeset
   153
			if (_display_opt & DO_TRANS_BUILDINGS)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   154
				image = (image & 0x3FFF) | 0x3224000;
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   155
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   156
			AddSortableSpriteToDraw(image,
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   157
				ti->x | dtus->subcoord_x,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   158
				ti->y | dtus->subcoord_y,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   159
				dtus->width, dtus->height,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   160
				dtus->z_size, ti->z);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   161
		}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   162
	} else {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   163
		const DrawTileSeqStruct *dtss;
384
bf1303e754ff (svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents: 222
diff changeset
   164
		const DrawTileSprites *t;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   165
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   166
		if (ti->tileh) DrawFoundation(ti, ti->tileh);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   167
1901
fb05044cf5c3 (svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner
tron
parents: 1891
diff changeset
   168
		ormod = PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   169
384
bf1303e754ff (svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents: 222
diff changeset
   170
		t = &_unmovable_display_datas[ti->map5 & 0x7F];
bf1303e754ff (svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents: 222
diff changeset
   171
		DrawGroundSprite(t->ground_sprite | ormod);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   172
384
bf1303e754ff (svn r576) -newgrf: Cleanup horrible table/(station|unmovable)_land.h DrawTileSeqStruct hacks needed for custom station supports (pasky)
darkvater
parents: 222
diff changeset
   173
		foreach_draw_tile_seq(dtss, t->seq) {
2026
02dfa0aa2c2f (svn r2535) Tabs
tron
parents: 1981
diff changeset
   174
			image = dtss->image;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   175
			if (_display_opt & DO_TRANS_BUILDINGS) {
497
2d6d31173813 (svn r787) Invert the sense of the DO_TRANS_BUILDINGS flag to be consistent with its own name and all other DO_* flags.
tron
parents: 473
diff changeset
   176
				image = (image & 0x3FFF) | 0x03224000;
2d6d31173813 (svn r787) Invert the sense of the DO_TRANS_BUILDINGS flag to be consistent with its own name and all other DO_* flags.
tron
parents: 473
diff changeset
   177
			} else {
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   178
				image |= ormod;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   179
			}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   180
			AddSortableSpriteToDraw(image, ti->x + dtss->delta_x, ti->y + dtss->delta_y,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   181
				dtss->width, dtss->height, dtss->unk, ti->z + dtss->delta_z);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   182
		}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   183
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   184
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   185
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   186
static uint GetSlopeZ_Unmovable(TileInfo *ti)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   187
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   188
	return GetPartialZ(ti->x&0xF, ti->y&0xF, ti->tileh) + ti->z;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   189
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   190
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   191
static uint GetSlopeTileh_Unmovable(TileInfo *ti)
39
d177340ed556 (svn r40) Final slope graphics fix
dominik
parents: 0
diff changeset
   192
{
d177340ed556 (svn r40) Final slope graphics fix
dominik
parents: 0
diff changeset
   193
	return 0;
d177340ed556 (svn r40) Final slope graphics fix
dominik
parents: 0
diff changeset
   194
}
d177340ed556 (svn r40) Final slope graphics fix
dominik
parents: 0
diff changeset
   195
1977
4392ae3d8e31 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1962
diff changeset
   196
static int32 ClearTile_Unmovable(TileIndex tile, byte flags)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   197
{
2049
ad0d49c916d4 (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents: 2026
diff changeset
   198
	byte m5 = _m[tile].m5;
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   199
147
d0c8100d18cf (svn r148) -Feature: Company HQ can now be moved somewhere else (cost 1% of company value). Water floods HQ.
darkvater
parents: 39
diff changeset
   200
	if (m5 & 0x80) {
1796
cae31916ae54 (svn r2300) - CodeChange: check the last number of commands, now only the refit ones remain, and some server-only commands.
Darkvater
parents: 1792
diff changeset
   201
		if (_current_player == OWNER_WATER) return DestroyCompanyHQ(tile, DC_EXEC);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   202
		return_cmd_error(STR_5804_COMPANY_HEADQUARTERS_IN);
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   203
	}
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   204
2026
02dfa0aa2c2f (svn r2535) Tabs
tron
parents: 1981
diff changeset
   205
	if (m5 == 3) // company owned land
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   206
		return DoCommandByTile(tile, 0, 0, flags, CMD_SELL_LAND_AREA);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   207
149
5f7d4b21df01 (svn r150) -Fix: [1010833] Turning on the magic bulldozer removes oil rigs
darkvater
parents: 147
diff changeset
   208
	// checks if you're allowed to remove unmovable things
5f7d4b21df01 (svn r150) -Fix: [1010833] Turning on the magic bulldozer removes oil rigs
darkvater
parents: 147
diff changeset
   209
	if (_game_mode != GM_EDITOR && _current_player != OWNER_WATER && ((flags & DC_AUTO || !_cheats.magic_bulldozer.value)) )
5f7d4b21df01 (svn r150) -Fix: [1010833] Turning on the magic bulldozer removes oil rigs
darkvater
parents: 147
diff changeset
   210
		return_cmd_error(STR_5800_OBJECT_IN_THE_WAY);
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   211
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   212
	if (flags & DC_EXEC) {
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   213
		DoClearSquare(tile);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   214
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   215
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   216
	return 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   217
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   218
1977
4392ae3d8e31 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1962
diff changeset
   219
static void GetAcceptedCargo_Unmovable(TileIndex tile, AcceptedCargo ac)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   220
{
2049
ad0d49c916d4 (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents: 2026
diff changeset
   221
	byte m5 = _m[tile].m5;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   222
	uint level; // HQ level (depends on company performance) in the range 1..5.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   223
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   224
	if (!(m5 & 0x80)) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   225
		/* not used */
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   226
		return;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   227
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   228
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   229
	/* HQ accepts passenger and mail; but we have to divide the values
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   230
	 * between 4 tiles it occupies! */
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   231
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   232
	level = (m5 & ~0x80) / 4 + 1;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   233
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   234
	// Top town building generates 10, so to make HQ interesting, the top
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   235
	// type makes 20.
473
0da86c59e3ae (svn r724) Remove restriction that a tile can only accept 3 cargo types.
tron
parents: 410
diff changeset
   236
	ac[CT_PASSENGERS] = max(1, level);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   237
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   238
	// Top town building generates 4, HQ can make up to 8. The
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   239
	// proportion passengers:mail is different because such a huge
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   240
	// commercial building generates unusually high amount of mail
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   241
	// correspondence per physical visitor.
473
0da86c59e3ae (svn r724) Remove restriction that a tile can only accept 3 cargo types.
tron
parents: 410
diff changeset
   242
	ac[CT_MAIL] = max(1, level / 2);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   243
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   244
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   245
static const StringID _unmovable_tile_str[] = {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   246
	STR_5803_COMPANY_HEADQUARTERS,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   247
	STR_5801_TRANSMITTER,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   248
	STR_5802_LIGHTHOUSE,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   249
	STR_2016_STATUE,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   250
	STR_5805_COMPANY_OWNED_LAND,
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   251
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   252
1977
4392ae3d8e31 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1962
diff changeset
   253
static void GetTileDesc_Unmovable(TileIndex tile, TileDesc *td)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   254
{
2049
ad0d49c916d4 (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents: 2026
diff changeset
   255
	int i = _m[tile].m5;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   256
	if (i & 0x80) i = -1;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   257
	td->str = _unmovable_tile_str[i + 1];
1901
fb05044cf5c3 (svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner
tron
parents: 1891
diff changeset
   258
	td->owner = GetTileOwner(tile);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   259
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   260
1977
4392ae3d8e31 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1962
diff changeset
   261
static void AnimateTile_Unmovable(TileIndex tile)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   262
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   263
	/* not used */
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   264
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   265
1977
4392ae3d8e31 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1962
diff changeset
   266
static void TileLoop_Unmovable(TileIndex tile)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   267
{
2049
ad0d49c916d4 (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents: 2026
diff changeset
   268
	byte m5 = _m[tile].m5;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   269
	byte level; // HQ level (depends on company performance) in the range 1..5.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   270
	uint32 r;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   271
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   272
	if (!(m5 & 0x80)) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   273
		/* not used */
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   274
		return;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   275
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   276
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   277
	/* HQ accepts passenger and mail; but we have to divide the values
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   278
	 * between 4 tiles it occupies! */
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   279
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   280
	level = (m5 & ~0x80) / 4 + 1;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   281
	assert(level < 6);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   282
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   283
	r = Random();
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   284
	// Top town buildings generate 250, so the top HQ type makes 256.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   285
	if ((byte) r < (256 / 4 /  (6 - level))) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   286
		uint amt = ((byte) r >> 3) / 4 + 1;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   287
		if (_economy.fluct <= 0) amt = (amt + 1) >> 1;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   288
		MoveGoodsToStation(tile, 2, 2, CT_PASSENGERS, amt);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   289
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   290
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   291
	r >>= 8;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   292
	// Top town building generates 90, HQ can make up to 196. The
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   293
	// proportion passengers:mail is about the same as in the acceptance
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   294
	// equations.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   295
	if ((byte) r < (196 / 4 / (6 - level))) {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   296
		uint amt = ((byte) r >> 3) / 4 + 1;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   297
		if (_economy.fluct <= 0) amt = (amt + 1) >> 1;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   298
		MoveGoodsToStation(tile, 2, 2, CT_MAIL, amt);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   299
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   300
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   301
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   302
1977
4392ae3d8e31 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1962
diff changeset
   303
static uint32 GetTileTrackStatus_Unmovable(TileIndex tile, TransportType mode)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   304
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   305
	return 0;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   306
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   307
1977
4392ae3d8e31 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1962
diff changeset
   308
static void ClickTile_Unmovable(TileIndex tile)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   309
{
2049
ad0d49c916d4 (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents: 2026
diff changeset
   310
	if (_m[tile].m5 & 0x80) {
1901
fb05044cf5c3 (svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner
tron
parents: 1891
diff changeset
   311
		ShowPlayerCompany(GetTileOwner(tile));
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   312
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   313
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   314
909
81bc9ef93f50 (svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents: 889
diff changeset
   315
static const TileIndexDiffC _tile_add[] = {
81bc9ef93f50 (svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents: 889
diff changeset
   316
	{ 1,  0},
81bc9ef93f50 (svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents: 889
diff changeset
   317
	{ 0,  1},
81bc9ef93f50 (svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents: 889
diff changeset
   318
	{-1,  0},
81bc9ef93f50 (svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents: 889
diff changeset
   319
	{ 0, -1}
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   320
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   321
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   322
/* checks, if a radio tower is within a 9x9 tile square around tile */
1977
4392ae3d8e31 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1962
diff changeset
   323
static bool checkRadioTowerNearby(TileIndex tile)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   324
{
1981
de031d2aed47 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY
tron
parents: 1980
diff changeset
   325
	TileIndex tile_s = tile - TileDiffXY(4, 4);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   326
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   327
	BEGIN_TILE_LOOP(tile, 9, 9, tile_s)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   328
		// already a radio tower here?
2049
ad0d49c916d4 (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents: 2026
diff changeset
   329
		if (IsTileType(tile, MP_UNMOVABLE) && _m[tile].m5 == 0)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   330
			return false;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   331
	END_TILE_LOOP(tile, 9, 9, tile_s)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   332
	return true;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   333
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   334
1093
e8d26c7dc42f (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents: 1059
diff changeset
   335
void GenerateUnmovables(void)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   336
{
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   337
	int i,j;
1977
4392ae3d8e31 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1962
diff changeset
   338
	TileIndex tile;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   339
	uint32 r;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   340
	int dir;
1335
a635854c23b6 (svn r1839) Move GetTileSlope() and GetTileZ() into tile.[ch] and use more explicit types as parameters
tron
parents: 1225
diff changeset
   341
	uint h;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   342
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   343
	if (_opt.landscape == LT_CANDY)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   344
		return;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   345
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   346
	/* add radio tower */
1202
7d8b86bd8ba2 (svn r1706) Implement ScaleByMapSize() and ScaleByMapSize1D()
tron
parents: 1093
diff changeset
   347
	i = ScaleByMapSize(1000);
7d8b86bd8ba2 (svn r1706) Implement ScaleByMapSize() and ScaleByMapSize1D()
tron
parents: 1093
diff changeset
   348
	j = ScaleByMapSize(40); // maximum number of radio towers on the map
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   349
	do {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   350
		r = Random();
863
8d09f9331a80 (svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY]
tron
parents: 856
diff changeset
   351
		tile = r % MapSize();
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   352
//		TILE_MASK seems to be not working correctly. Radio masts accumulate in one area.
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   353
//		tile = TILE_MASK(r);
1035
0a170deb6e33 (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents: 926
diff changeset
   354
		if (IsTileType(tile, MP_CLEAR) && GetTileSlope(tile, &h) == 0 && h >= 32) {
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   355
			if(!checkRadioTowerNearby(tile))
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   356
				continue;
1059
c28c6be74291 (svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents: 1035
diff changeset
   357
			SetTileType(tile, MP_UNMOVABLE);
2049
ad0d49c916d4 (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents: 2026
diff changeset
   358
			_m[tile].m5 = 0;
1902
5d653da1abb7 (svn r2408) Introduce SetTileOwner() and use it
tron
parents: 1901
diff changeset
   359
			SetTileOwner(tile, OWNER_NONE);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   360
			if (--j == 0)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   361
				break;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   362
		}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   363
	} while (--i);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   364
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   365
	if (_opt.landscape == LT_DESERT)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   366
		return;
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   367
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   368
	/* add lighthouses */
1202
7d8b86bd8ba2 (svn r1706) Implement ScaleByMapSize() and ScaleByMapSize1D()
tron
parents: 1093
diff changeset
   369
	i = ScaleByMapSize1D((Random() & 3) + 7);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   370
	do {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   371
restart:
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   372
		r = Random();
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   373
		dir = r >> 30;
856
07dc27d0503e (svn r1337) Use MapMax[XY]() (or MapSize[XY]() if appropriate) instead of TILE_MAX_[XY]
tron
parents: 679
diff changeset
   374
		r %= (dir == 0 || dir == 2) ? MapMaxY() : MapMaxX();
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   375
		tile =
1981
de031d2aed47 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY
tron
parents: 1980
diff changeset
   376
			(dir == 0) ? TileXY(0, r)         : 0 + // left
de031d2aed47 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY
tron
parents: 1980
diff changeset
   377
			(dir == 1) ? TileXY(r, 0)         : 0 + // top
de031d2aed47 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY
tron
parents: 1980
diff changeset
   378
			(dir == 2) ? TileXY(MapMaxX(), r) : 0 + // right
de031d2aed47 (svn r2487) Replace TILE_XY by TileXY/TileDiffXY
tron
parents: 1980
diff changeset
   379
			(dir == 3) ? TileXY(r, MapMaxY()) : 0;  // bottom
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   380
		j = 20;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   381
		do {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   382
			if (--j == 0)
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   383
				goto restart;
909
81bc9ef93f50 (svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents: 889
diff changeset
   384
			tile = TILE_MASK(tile + ToTileIndexDiff(_tile_add[dir]));
1035
0a170deb6e33 (svn r1536) Move GET_TILEHEIGHT, GET_TILETYPE and IS_TILETYPE to map.h, turn them into inline functions and add some asserts
tron
parents: 926
diff changeset
   385
		} while (!(IsTileType(tile, MP_CLEAR) && GetTileSlope(tile, &h) == 0 && h <= 16));
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   386
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   387
		assert(tile == TILE_MASK(tile));
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   388
1059
c28c6be74291 (svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents: 1035
diff changeset
   389
		SetTileType(tile, MP_UNMOVABLE);
2049
ad0d49c916d4 (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents: 2026
diff changeset
   390
		_m[tile].m5 = 1;
1902
5d653da1abb7 (svn r2408) Introduce SetTileOwner() and use it
tron
parents: 1901
diff changeset
   391
		SetTileOwner(tile, OWNER_NONE);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   392
	} while (--i);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   393
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   394
1977
4392ae3d8e31 (svn r2483) Replace almost 500 "uint tile" (and variants) with "TileIndex tile"
tron
parents: 1962
diff changeset
   395
static void ChangeTileOwner_Unmovable(TileIndex tile, byte old_player, byte new_player)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   396
{
1901
fb05044cf5c3 (svn r2407) Use {Get,Is}TileOwner to get/check the owner of a tile and fix some bogus reads of _map_owner
tron
parents: 1891
diff changeset
   397
	if (!IsTileOwner(tile, old_player)) return;
193
0a7025304867 (svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents: 160
diff changeset
   398
2049
ad0d49c916d4 (svn r2558) Change the internal map format from 7 arrays to one array of structs, this doesn't change the saved format for now. It's a stepping stone for further changes.
tron
parents: 2026
diff changeset
   399
	if (_m[tile].m5==3 && new_player != 255) {
1902
5d653da1abb7 (svn r2408) Introduce SetTileOwner() and use it
tron
parents: 1901
diff changeset
   400
		SetTileOwner(tile, new_player);
2026
02dfa0aa2c2f (svn r2535) Tabs
tron
parents: 1981
diff changeset
   401
	} else {
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   402
		DoClearSquare(tile);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   403
	}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   404
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   405
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   406
const TileTypeProcs _tile_type_unmovable_procs = {
1493
ea21c3f7feea (svn r1997) Fixed errorneous tab expansion on the indentation side which happenned in r1993. Pointed out by Tron.
pasky
parents: 1489
diff changeset
   407
	DrawTile_Unmovable,             /* draw_tile_proc */
ea21c3f7feea (svn r1997) Fixed errorneous tab expansion on the indentation side which happenned in r1993. Pointed out by Tron.
pasky
parents: 1489
diff changeset
   408
	GetSlopeZ_Unmovable,            /* get_slope_z_proc */
ea21c3f7feea (svn r1997) Fixed errorneous tab expansion on the indentation side which happenned in r1993. Pointed out by Tron.
pasky
parents: 1489
diff changeset
   409
	ClearTile_Unmovable,            /* clear_tile_proc */
ea21c3f7feea (svn r1997) Fixed errorneous tab expansion on the indentation side which happenned in r1993. Pointed out by Tron.
pasky
parents: 1489
diff changeset
   410
	GetAcceptedCargo_Unmovable,     /* get_accepted_cargo_proc */
ea21c3f7feea (svn r1997) Fixed errorneous tab expansion on the indentation side which happenned in r1993. Pointed out by Tron.
pasky
parents: 1489
diff changeset
   411
	GetTileDesc_Unmovable,          /* get_tile_desc_proc */
ea21c3f7feea (svn r1997) Fixed errorneous tab expansion on the indentation side which happenned in r1993. Pointed out by Tron.
pasky
parents: 1489
diff changeset
   412
	GetTileTrackStatus_Unmovable,   /* get_tile_track_status_proc */
ea21c3f7feea (svn r1997) Fixed errorneous tab expansion on the indentation side which happenned in r1993. Pointed out by Tron.
pasky
parents: 1489
diff changeset
   413
	ClickTile_Unmovable,            /* click_tile_proc */
ea21c3f7feea (svn r1997) Fixed errorneous tab expansion on the indentation side which happenned in r1993. Pointed out by Tron.
pasky
parents: 1489
diff changeset
   414
	AnimateTile_Unmovable,          /* animate_tile_proc */
ea21c3f7feea (svn r1997) Fixed errorneous tab expansion on the indentation side which happenned in r1993. Pointed out by Tron.
pasky
parents: 1489
diff changeset
   415
	TileLoop_Unmovable,             /* tile_loop_clear */
ea21c3f7feea (svn r1997) Fixed errorneous tab expansion on the indentation side which happenned in r1993. Pointed out by Tron.
pasky
parents: 1489
diff changeset
   416
	ChangeTileOwner_Unmovable,      /* change_tile_owner_clear */
ea21c3f7feea (svn r1997) Fixed errorneous tab expansion on the indentation side which happenned in r1993. Pointed out by Tron.
pasky
parents: 1489
diff changeset
   417
	NULL,                           /* get_produced_cargo_proc */
ea21c3f7feea (svn r1997) Fixed errorneous tab expansion on the indentation side which happenned in r1993. Pointed out by Tron.
pasky
parents: 1489
diff changeset
   418
	NULL,                           /* vehicle_enter_tile_proc */
ea21c3f7feea (svn r1997) Fixed errorneous tab expansion on the indentation side which happenned in r1993. Pointed out by Tron.
pasky
parents: 1489
diff changeset
   419
	NULL,                           /* vehicle_leave_tile_proc */
ea21c3f7feea (svn r1997) Fixed errorneous tab expansion on the indentation side which happenned in r1993. Pointed out by Tron.
pasky
parents: 1489
diff changeset
   420
	GetSlopeTileh_Unmovable,        /* get_slope_tileh_proc */
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   421
};