author | truelight |
Thu, 24 Mar 2005 14:43:40 +0000 | |
changeset 1540 | 6eef12dab5bf |
parent 1298 | d04721ba07f9 |
child 1571 | 9afc220894dd |
permissions | -rw-r--r-- |
0 | 1 |
#include "stdafx.h" |
2 |
#include "ttd.h" |
|
507
04b5403aaf6b
(svn r815) Include strings.h only in the files which need it.
tron
parents:
473
diff
changeset
|
3 |
#include "table/strings.h" |
679
04ca2cd69420
(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
2e00193652b2
(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 | 6 |
#include "viewport.h" |
7 |
#include "command.h" |
|
8 |
||
9 |
typedef struct TerraformerHeightMod { |
|
10 |
TileIndex tile; |
|
11 |
byte height; |
|
12 |
} TerraformerHeightMod; |
|
13 |
||
14 |
typedef struct TerraformerState { |
|
15 |
int height[4]; |
|
16 |
uint32 flags; |
|
17 |
||
18 |
int direction; |
|
19 |
int modheight_count; |
|
20 |
int tile_table_count; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
21 |
|
0 | 22 |
int32 cost; |
23 |
||
24 |
TileIndex *tile_table; |
|
25 |
TerraformerHeightMod *modheight; |
|
26 |
||
27 |
} TerraformerState; |
|
28 |
||
29 |
static int TerraformAllowTileProcess(TerraformerState *ts, TileIndex tile) |
|
30 |
{ |
|
31 |
TileIndex *t; |
|
32 |
int count; |
|
33 |
||
926
a6d140a6a4de
(svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY]
tron
parents:
909
diff
changeset
|
34 |
if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY()) |
0 | 35 |
return -1; |
36 |
||
37 |
t = ts->tile_table; |
|
38 |
for(count = ts->tile_table_count; count != 0; count--,t++) { |
|
39 |
if (*t == tile) |
|
40 |
return 0; |
|
41 |
} |
|
42 |
||
43 |
return 1; |
|
44 |
} |
|
45 |
||
46 |
static int TerraformGetHeightOfTile(TerraformerState *ts, TileIndex tile) |
|
47 |
{ |
|
48 |
TerraformerHeightMod *mod = ts->modheight; |
|
49 |
int count; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
50 |
|
0 | 51 |
for(count = ts->modheight_count; count != 0; count--, mod++) { |
52 |
if (mod->tile == tile) |
|
53 |
return mod->height; |
|
54 |
} |
|
55 |
||
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
56 |
return TileHeight(tile); |
0 | 57 |
} |
58 |
||
59 |
static void TerraformAddDirtyTile(TerraformerState *ts, TileIndex tile) |
|
60 |
{ |
|
61 |
int count; |
|
62 |
TileIndex *t; |
|
63 |
||
64 |
count = ts->tile_table_count; |
|
65 |
||
66 |
if (count >= 625) |
|
67 |
return; |
|
68 |
||
69 |
for(t = ts->tile_table; count != 0; count--,t++) { |
|
70 |
if (*t == tile) |
|
71 |
return; |
|
72 |
} |
|
73 |
||
74 |
ts->tile_table[ts->tile_table_count++] = tile; |
|
75 |
} |
|
76 |
||
77 |
static void TerraformAddDirtyTileAround(TerraformerState *ts, TileIndex tile) |
|
78 |
{ |
|
79 |
TerraformAddDirtyTile(ts, tile+TILE_XY(0,-1)); |
|
80 |
TerraformAddDirtyTile(ts, tile+TILE_XY(-1,-1)); |
|
81 |
TerraformAddDirtyTile(ts, tile+TILE_XY(-1,0)); |
|
82 |
TerraformAddDirtyTile(ts, tile); |
|
83 |
} |
|
84 |
||
85 |
static int TerraformProc(TerraformerState *ts, uint tile, int mode) |
|
86 |
{ |
|
87 |
int r; |
|
88 |
int32 ret; |
|
89 |
||
863
6a1444534f62
(svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY]
tron
parents:
856
diff
changeset
|
90 |
assert(tile < MapSize()); |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
91 |
|
0 | 92 |
if ((r=TerraformAllowTileProcess(ts, tile)) <= 0) |
93 |
return r; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
94 |
|
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
95 |
if (IsTileType(tile, MP_RAILWAY)) { |
0 | 96 |
static const byte _railway_modes[4] = {8, 0x10, 4, 0x20}; |
97 |
static const byte _railway_dangslopes[4] = {0xd, 0xe, 7, 0xb}; |
|
345
ba68d5714caf
(svn r526) -Fix: [1035303] bug about lowering tracks built on slopes
tron
parents:
193
diff
changeset
|
98 |
static const byte _railway_dangslopes2[4] = {0x2, 0x1, 0x8, 0x4}; |
0 | 99 |
|
100 |
// Nothing could be built at the steep slope - this avoids a bug |
|
101 |
// when you have a single diagonal track in one corner on a |
|
345
ba68d5714caf
(svn r526) -Fix: [1035303] bug about lowering tracks built on slopes
tron
parents:
193
diff
changeset
|
102 |
// basement and then you raise/lower the other corner. |
ba68d5714caf
(svn r526) -Fix: [1035303] bug about lowering tracks built on slopes
tron
parents:
193
diff
changeset
|
103 |
int tileh = GetTileSlope(tile, NULL) & 0xF; |
ba68d5714caf
(svn r526) -Fix: [1035303] bug about lowering tracks built on slopes
tron
parents:
193
diff
changeset
|
104 |
if (tileh == _railway_dangslopes[mode] || |
ba68d5714caf
(svn r526) -Fix: [1035303] bug about lowering tracks built on slopes
tron
parents:
193
diff
changeset
|
105 |
tileh == _railway_dangslopes2[mode]) { |
ba68d5714caf
(svn r526) -Fix: [1035303] bug about lowering tracks built on slopes
tron
parents:
193
diff
changeset
|
106 |
_terraform_err_tile = tile; |
0 | 107 |
_error_message = STR_1008_MUST_REMOVE_RAILROAD_TRACK; |
108 |
return -1; |
|
109 |
} |
|
110 |
||
111 |
// If we have a single diagonal track there, the other side of |
|
112 |
// tile can be terraformed. |
|
113 |
if ((_map5[tile]&~0x40) == _railway_modes[mode]) |
|
114 |
return 0; |
|
115 |
} |
|
116 |
||
117 |
ret = DoCommandByTile(tile, 0,0, ts->flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR); |
|
118 |
||
119 |
if (ret == CMD_ERROR) { |
|
120 |
_terraform_err_tile = tile; |
|
121 |
return -1; |
|
122 |
} |
|
123 |
||
124 |
ts->cost += ret; |
|
125 |
||
126 |
if (ts->tile_table_count >= 625) |
|
127 |
return -1; |
|
128 |
ts->tile_table[ts->tile_table_count++] = tile; |
|
129 |
||
130 |
return 0; |
|
131 |
} |
|
132 |
||
133 |
static bool TerraformTileHeight(TerraformerState *ts, uint tile, int height) |
|
134 |
{ |
|
135 |
int nh; |
|
136 |
TerraformerHeightMod *mod; |
|
137 |
int count; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
138 |
|
863
6a1444534f62
(svn r1344) Use MapSize[XY]() (or MapSize()/MapMax[XY]() where appropriate) instead of TILES_[XY]
tron
parents:
856
diff
changeset
|
139 |
assert(tile < MapSize()); |
0 | 140 |
|
141 |
if (height < 0) { |
|
142 |
_error_message = STR_1003_ALREADY_AT_SEA_LEVEL; |
|
143 |
return false; |
|
144 |
} |
|
145 |
||
146 |
_error_message = STR_1004_TOO_HIGH; |
|
147 |
||
148 |
if (height > 0xF) |
|
149 |
return false; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
150 |
|
0 | 151 |
nh = TerraformGetHeightOfTile(ts, tile); |
152 |
if (nh < 0 || height == nh) |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
153 |
return false; |
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
154 |
|
0 | 155 |
if (TerraformProc(ts, tile, 0)<0) |
156 |
return false; |
|
157 |
||
158 |
if (TerraformProc(ts, tile + TILE_XY(0,-1), 1)<0) |
|
159 |
return false; |
|
160 |
||
161 |
if (TerraformProc(ts, tile + TILE_XY(-1,-1), 2)<0) |
|
162 |
return false; |
|
163 |
||
164 |
if (TerraformProc(ts, tile + TILE_XY(-1,0), 3)<0) |
|
165 |
return false; |
|
166 |
||
167 |
mod = ts->modheight; |
|
168 |
count = ts->modheight_count; |
|
169 |
||
170 |
for(;;) { |
|
171 |
if (count == 0) { |
|
172 |
if (ts->modheight_count >= 576) |
|
173 |
return false; |
|
174 |
ts->modheight_count++; |
|
175 |
break; |
|
176 |
} |
|
177 |
if (mod->tile == (TileIndex)tile) |
|
178 |
break; |
|
179 |
mod++; |
|
180 |
count--; |
|
181 |
} |
|
182 |
||
183 |
mod->tile = (TileIndex)tile; |
|
184 |
mod->height = (byte)height; |
|
185 |
||
186 |
ts->cost += _price.terraform; |
|
187 |
||
188 |
{ |
|
189 |
int direction = ts->direction, r; |
|
909
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
190 |
const TileIndexDiffC *ttm; |
0 | 191 |
|
909
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
192 |
static const TileIndexDiffC _terraform_tilepos[] = { |
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
193 |
{ 1, 0}, |
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
194 |
{-2, 0}, |
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
195 |
{ 1, 1}, |
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
196 |
{ 0, -2} |
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
197 |
}; |
0 | 198 |
|
909
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
199 |
for(ttm = _terraform_tilepos; ttm != endof(_terraform_tilepos); ttm++) { |
65cdb609b7a6
(svn r1396) Introduce TileIndexDiffC - the compile time version of TileIndexDiff
tron
parents:
900
diff
changeset
|
200 |
tile += ToTileIndexDiff(*ttm); |
0 | 201 |
|
202 |
r = TerraformGetHeightOfTile(ts, tile); |
|
203 |
if (r != height && r-direction != height && r+direction != height) { |
|
204 |
if (!TerraformTileHeight(ts, tile, r+direction)) |
|
205 |
return false; |
|
206 |
} |
|
207 |
} |
|
208 |
} |
|
209 |
||
210 |
return true; |
|
211 |
} |
|
212 |
||
213 |
/* Terraform land |
|
214 |
* p1 - corners |
|
215 |
* p2 - direction |
|
216 |
*/ |
|
217 |
||
218 |
int32 CmdTerraformLand(int x, int y, uint32 flags, uint32 p1, uint32 p2) |
|
219 |
{ |
|
220 |
TerraformerState ts; |
|
221 |
uint tile; |
|
222 |
int direction; |
|
223 |
||
224 |
TerraformerHeightMod modheight_data[576]; |
|
225 |
TileIndex tile_table_data[625]; |
|
226 |
||
227 |
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); |
|
228 |
||
229 |
_error_message = INVALID_STRING_ID; |
|
230 |
_terraform_err_tile = 0; |
|
231 |
||
232 |
ts.direction = direction = p2 ? 1 : -1; |
|
233 |
ts.flags = flags; |
|
234 |
ts.modheight_count = ts.tile_table_count = 0; |
|
235 |
ts.cost = 0; |
|
236 |
ts.modheight = modheight_data; |
|
237 |
ts.tile_table = tile_table_data; |
|
238 |
||
239 |
tile = TILE_FROM_XY(x,y); |
|
240 |
||
241 |
if (p1 & 1) { |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
242 |
if (!TerraformTileHeight(&ts, tile+TILE_XY(1,0), |
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
243 |
TileHeight(tile + TILE_XY(1, 0)) + direction)) |
0 | 244 |
return CMD_ERROR; |
245 |
} |
|
246 |
||
247 |
if (p1 & 2) { |
|
248 |
if (!TerraformTileHeight(&ts, tile+TILE_XY(1,1), |
|
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
249 |
TileHeight(tile + TILE_XY(1, 1)) + direction)) |
0 | 250 |
return CMD_ERROR; |
251 |
} |
|
252 |
||
253 |
if (p1 & 4) { |
|
254 |
if (!TerraformTileHeight(&ts, tile+TILE_XY(0,1), |
|
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
255 |
TileHeight(tile + TILE_XY(0, 1)) + direction)) |
0 | 256 |
return CMD_ERROR; |
257 |
} |
|
258 |
||
259 |
if (p1 & 8) { |
|
260 |
if (!TerraformTileHeight(&ts, tile+TILE_XY(0,0), |
|
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
261 |
TileHeight(tile + TILE_XY(0, 0)) + direction)) |
0 | 262 |
return CMD_ERROR; |
263 |
} |
|
264 |
||
265 |
if (direction == -1) { |
|
266 |
/* Check if tunnel would take damage */ |
|
267 |
int count; |
|
268 |
TileIndex *ti = ts.tile_table; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
269 |
|
0 | 270 |
for(count = ts.tile_table_count; count != 0; count--, ti++) { |
271 |
uint z, t; |
|
272 |
uint tile = *ti; |
|
273 |
||
274 |
z = TerraformGetHeightOfTile(&ts, tile + TILE_XY(0,0)); |
|
275 |
t = TerraformGetHeightOfTile(&ts, tile + TILE_XY(1,0)); |
|
276 |
if (t <= z) z = t; |
|
277 |
t = TerraformGetHeightOfTile(&ts, tile + TILE_XY(1,1)); |
|
278 |
if (t <= z) z = t; |
|
279 |
t = TerraformGetHeightOfTile(&ts, tile + TILE_XY(0,1)); |
|
280 |
if (t <= z) z = t; |
|
281 |
||
282 |
if (!CheckTunnelInWay(tile, z*8)) |
|
283 |
return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE); |
|
284 |
} |
|
285 |
} |
|
286 |
||
287 |
if (flags & DC_EXEC) { |
|
288 |
/* Clear the landscape at the tiles */ |
|
289 |
{ |
|
290 |
int count; |
|
291 |
TileIndex *ti = ts.tile_table; |
|
292 |
for(count = ts.tile_table_count; count != 0; count--, ti++) { |
|
293 |
DoCommandByTile(*ti, 0, 0, flags, CMD_LANDSCAPE_CLEAR); |
|
294 |
} |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
295 |
} |
0 | 296 |
|
297 |
/* change the height */ |
|
298 |
{ |
|
299 |
int count; |
|
300 |
TerraformerHeightMod *mod; |
|
301 |
uint til; |
|
302 |
||
303 |
mod = ts.modheight; |
|
304 |
for(count = ts.modheight_count; count != 0; count--, mod++) { |
|
305 |
til = mod->tile; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
306 |
|
1059
fe97d81a1b4f
(svn r1560) Introduce SetTileType() and SetTileHeight()
tron
parents:
1044
diff
changeset
|
307 |
SetTileHeight(til, mod->height); |
0 | 308 |
TerraformAddDirtyTileAround(&ts, til); |
309 |
} |
|
310 |
} |
|
311 |
||
312 |
/* finally mark the dirty tiles dirty */ |
|
313 |
{ |
|
314 |
int count; |
|
315 |
TileIndex *ti = ts.tile_table; |
|
316 |
for(count = ts.tile_table_count; count != 0; count--, ti++) { |
|
317 |
MarkTileDirtyByTile(*ti); |
|
318 |
} |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
319 |
} |
0 | 320 |
} |
321 |
return ts.cost; |
|
322 |
} |
|
323 |
||
324 |
||
325 |
/* |
|
326 |
* p1 - start |
|
327 |
*/ |
|
328 |
||
329 |
int32 CmdLevelLand(int ex, int ey, uint32 flags, uint32 p1, uint32 p2) |
|
330 |
{ |
|
331 |
int size_x, size_y; |
|
332 |
int sx, sy; |
|
333 |
uint h, curh; |
|
334 |
uint tile; |
|
335 |
int32 ret, cost, money; |
|
336 |
||
889
64d2f7d5f02b
(svn r1375) -Fix: [1050990] Buying trains sometimes accounted for incorrectly. Was the result of the cost getting reset in a recursive call of docommand. That is fixed. In addition all cost-commands are typed explicitely. Please do not forget to do so or your costs will be credited to construction if you are unlucky.
darkvater
parents:
863
diff
changeset
|
337 |
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); |
64d2f7d5f02b
(svn r1375) -Fix: [1050990] Buying trains sometimes accounted for incorrectly. Was the result of the cost getting reset in a recursive call of docommand. That is fixed. In addition all cost-commands are typed explicitely. Please do not forget to do so or your costs will be credited to construction if you are unlucky.
darkvater
parents:
863
diff
changeset
|
338 |
|
0 | 339 |
// remember level height |
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
340 |
h = TileHeight(p1); |
0 | 341 |
|
342 |
ex >>= 4; ey >>= 4; |
|
343 |
||
344 |
// make sure sx,sy are smaller than ex,ey |
|
926
a6d140a6a4de
(svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY]
tron
parents:
909
diff
changeset
|
345 |
sx = TileX(p1); |
a6d140a6a4de
(svn r1414) Move TileIndex, TILE_MASK and GET_TILE_[XY] to map.h and turn the latter into inline functions names Tile[XY]
tron
parents:
909
diff
changeset
|
346 |
sy = TileY(p1); |
0 | 347 |
if (ex < sx) intswap(ex, sx); |
348 |
if (ey < sy) intswap(ey, sy); |
|
349 |
tile = TILE_XY(sx,sy); |
|
350 |
||
351 |
size_x = ex-sx+1; |
|
352 |
size_y = ey-sy+1; |
|
353 |
||
354 |
money = GetAvailableMoneyForCommand(); |
|
355 |
cost = 0; |
|
356 |
||
357 |
BEGIN_TILE_LOOP(tile2, size_x, size_y, tile) |
|
1044
63e0601a43cc
(svn r1545) Add TileHeight() which returns the height (not multiplied by 8)
tron
parents:
1035
diff
changeset
|
358 |
curh = TileHeight(tile2); |
0 | 359 |
while (curh != h) { |
360 |
ret = DoCommandByTile(tile2, 8, (curh > h)?0:1, flags & ~DC_EXEC, CMD_TERRAFORM_LAND); |
|
361 |
if (ret == CMD_ERROR) break; |
|
362 |
cost += ret; |
|
363 |
||
364 |
if (flags & DC_EXEC) { |
|
365 |
if ((money -= ret) < 0) { |
|
366 |
_additional_cash_required = ret; |
|
367 |
return cost - ret; |
|
368 |
} |
|
369 |
DoCommandByTile(tile2, 8, (curh > h)?0:1, flags, CMD_TERRAFORM_LAND); |
|
370 |
} |
|
371 |
||
372 |
curh += (curh > h) ? -1 : 1; |
|
373 |
} |
|
374 |
END_TILE_LOOP(tile2, size_x, size_y, tile) |
|
375 |
||
376 |
if (cost == 0) return CMD_ERROR; |
|
377 |
return cost; |
|
378 |
} |
|
379 |
||
380 |
/* Purchase a land area |
|
381 |
* p1 = unused |
|
382 |
* p2 = unused |
|
383 |
*/ |
|
384 |
||
385 |
int32 CmdPurchaseLandArea(int x, int y, uint32 flags, uint32 p1, uint32 p2) |
|
386 |
{ |
|
387 |
uint tile; |
|
388 |
int32 cost; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
389 |
|
0 | 390 |
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
391 |
|
0 | 392 |
tile = TILE_FROM_XY(x,y); |
393 |
||
394 |
if (!EnsureNoVehicle(tile)) |
|
395 |
return CMD_ERROR; |
|
396 |
||
1035
812f837ee03f
(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
|
397 |
if (IsTileType(tile, MP_UNMOVABLE) && |
0 | 398 |
_map5[tile] == 3 && |
399 |
_map_owner[tile] == _current_player) |
|
400 |
return_cmd_error(STR_5807_YOU_ALREADY_OWN_IT); |
|
401 |
||
402 |
cost = DoCommandByTile(tile, 0, 0, flags, CMD_LANDSCAPE_CLEAR); |
|
403 |
if (cost == CMD_ERROR) |
|
404 |
return CMD_ERROR; |
|
405 |
||
406 |
if (flags & DC_EXEC) { |
|
407 |
ModifyTile(tile, |
|
408 |
MP_SETTYPE(MP_UNMOVABLE) | MP_MAPOWNER_CURRENT | MP_MAP5, |
|
409 |
3 /* map5 */ |
|
410 |
); |
|
411 |
} |
|
412 |
||
413 |
return cost + _price.purchase_land * 10; |
|
414 |
} |
|
415 |
||
416 |
||
1095 | 417 |
static int32 ClearTile_Clear(uint tile, byte flags) |
418 |
{ |
|
0 | 419 |
static const int32 * _clear_price_table[] = { |
420 |
NULL, |
|
421 |
&_price.clear_1, &_price.clear_1,&_price.clear_1, |
|
422 |
&_price.purchase_land,&_price.purchase_land,&_price.purchase_land,&_price.purchase_land, |
|
423 |
&_price.clear_2,&_price.clear_2,&_price.clear_2,&_price.clear_2, |
|
424 |
&_price.clear_3,&_price.clear_3,&_price.clear_3,&_price.clear_3, |
|
425 |
&_price.purchase_land,&_price.purchase_land,&_price.purchase_land,&_price.purchase_land, |
|
426 |
&_price.purchase_land,&_price.purchase_land,&_price.purchase_land,&_price.purchase_land, |
|
427 |
&_price.clear_2,&_price.clear_2,&_price.clear_2,&_price.clear_2, |
|
428 |
}; |
|
429 |
const int32 *price = _clear_price_table[_map5[tile] & 0x1F]; |
|
430 |
||
431 |
if (flags & DC_EXEC) |
|
432 |
DoClearSquare(tile); |
|
433 |
||
434 |
if (price == NULL) |
|
435 |
return 0; |
|
436 |
return *price; |
|
437 |
} |
|
438 |
||
439 |
int32 CmdSellLandArea(int x, int y, uint32 flags, uint32 p1, uint32 p2) |
|
440 |
{ |
|
441 |
uint tile; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
442 |
|
0 | 443 |
SET_EXPENSES_TYPE(EXPENSES_CONSTRUCTION); |
444 |
||
445 |
tile = TILE_FROM_XY(x,y); |
|
446 |
||
149
5f7d4b21df01
(svn r150) -Fix: [1010833] Turning on the magic bulldozer removes oil rigs
darkvater
parents:
39
diff
changeset
|
447 |
if (!CheckTileOwnership(tile) && _current_player != OWNER_WATER) |
0 | 448 |
return CMD_ERROR; |
449 |
||
450 |
if (!EnsureNoVehicle(tile)) |
|
451 |
return CMD_ERROR; |
|
452 |
||
453 |
if (flags & DC_EXEC) |
|
454 |
DoClearSquare(tile); |
|
455 |
||
456 |
return - _price.purchase_land*2; |
|
457 |
} |
|
458 |
||
459 |
||
460 |
#include "table/clear_land.h" |
|
461 |
||
462 |
||
463 |
void DrawClearLandTile(TileInfo *ti, byte set) |
|
464 |
{ |
|
465 |
DrawGroundSprite(0xF54 + _tileh_to_sprite[ti->tileh] + set * 19); |
|
466 |
} |
|
467 |
||
468 |
void DrawHillyLandTile(TileInfo *ti) |
|
469 |
{ |
|
470 |
if (ti->tileh != 0) { |
|
471 |
DrawGroundSprite(0xFA0 + _tileh_to_sprite[ti->tileh]); |
|
472 |
} else { |
|
473 |
DrawGroundSprite(_landscape_clear_sprites[((ti->x^ti->y) >> 4) & 0x7]); |
|
474 |
} |
|
475 |
} |
|
476 |
||
477 |
void DrawClearLandFence(TileInfo *ti, byte img) |
|
478 |
{ |
|
479 |
byte z = ti->z; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
480 |
|
0 | 481 |
if (ti->tileh & 2) { |
482 |
z += 8; |
|
483 |
if (ti->tileh == 0x17) |
|
484 |
z += 8; |
|
485 |
} |
|
486 |
||
487 |
if (img & 0x38) { |
|
488 |
DrawGroundSpriteAt(_clear_land_fence_sprites_1[((img >> 3) & 7) - 1] + _fence_mod_by_tileh[ti->tileh], ti->x, ti->y, z); |
|
489 |
} |
|
490 |
||
491 |
if (img & 0x7) { |
|
492 |
DrawGroundSpriteAt(_clear_land_fence_sprites_1[(img & 7) - 1] + _fence_mod_by_tileh_2[ti->tileh], ti->x, ti->y, z); |
|
493 |
} |
|
494 |
} |
|
495 |
||
496 |
static void DrawTile_Clear(TileInfo *ti) |
|
497 |
{ |
|
498 |
||
499 |
switch((ti->map5 & (7<<2)) >> 2) { |
|
500 |
case 0: |
|
501 |
DrawClearLandTile(ti, (ti->map5 & 3)); |
|
502 |
break; |
|
503 |
||
504 |
case 1: |
|
505 |
DrawHillyLandTile(ti); |
|
506 |
break; |
|
507 |
||
508 |
case 2: |
|
509 |
DrawGroundSprite(0xFB7 + _tileh_to_sprite[ti->tileh]); |
|
510 |
break; |
|
511 |
||
512 |
case 3: |
|
513 |
DrawGroundSprite( _clear_land_sprites_1[_map3_lo[ti->tile]&0xF] + _tileh_to_sprite[ti->tileh]); |
|
514 |
break; |
|
515 |
||
516 |
case 4: |
|
517 |
DrawGroundSprite( _clear_land_sprites_2[ti->map5&3] + _tileh_to_sprite[ti->tileh]); |
|
518 |
break; |
|
519 |
||
520 |
case 5: |
|
521 |
DrawGroundSprite( _clear_land_sprites_3[ti->map5&3] + _tileh_to_sprite[ti->tileh]); |
|
522 |
break; |
|
523 |
} |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
524 |
|
0 | 525 |
DrawClearLandFence(ti, _map3_hi[ti->tile] >> 2); |
526 |
} |
|
527 |
||
1095 | 528 |
static uint GetSlopeZ_Clear(TileInfo *ti) |
529 |
{ |
|
530 |
return GetPartialZ(ti->x & 0xF, ti->y & 0xF, ti->tileh) + ti->z; |
|
531 |
} |
|
0 | 532 |
|
1095 | 533 |
static uint GetSlopeTileh_Clear(TileInfo *ti) |
39 | 534 |
{ |
535 |
return ti->tileh; |
|
536 |
} |
|
537 |
||
473
77f0ef57e7cf
(svn r724) Remove restriction that a tile can only accept 3 cargo types.
tron
parents:
410
diff
changeset
|
538 |
static void GetAcceptedCargo_Clear(uint tile, AcceptedCargo ac) |
0 | 539 |
{ |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
540 |
/* unused */ |
0 | 541 |
} |
542 |
||
543 |
static void AnimateTile_Clear(uint tile) |
|
544 |
{ |
|
545 |
/* unused */ |
|
546 |
} |
|
547 |
||
1293 | 548 |
void TileLoopClearHelper(TileIndex tile) |
0 | 549 |
{ |
1293 | 550 |
byte img_1; |
551 |
byte img_2; |
|
552 |
static byte img_by_map5[] = { 0, 0, 0, 2, 1, 1, 0, 0 }; |
|
553 |
TileIndex dirty = INVALID_TILE; |
|
0 | 554 |
|
1293 | 555 |
switch (GetTileType(tile)) { |
556 |
case MP_CLEAR: |
|
557 |
img_1 = img_by_map5[(_map5[tile] & 0x1C) >> 2]; |
|
558 |
break; |
|
559 |
||
560 |
case MP_TREES: |
|
561 |
if ((_map2[tile] & 0x30) == 0x20) |
|
562 |
img_1 = 1; |
|
563 |
else |
|
564 |
img_1 = 0; |
|
1298 | 565 |
break; |
1293 | 566 |
|
567 |
default: |
|
568 |
img_1 = 0; |
|
569 |
break; |
|
0 | 570 |
} |
571 |
||
1293 | 572 |
switch (GetTileType(TILE_ADDXY(tile, 1, 0))) { |
573 |
case MP_CLEAR: |
|
574 |
img_2 = img_by_map5[(_map5[TILE_ADDXY(tile, 1, 0)] & 0x1C) >> 2]; |
|
575 |
break; |
|
576 |
||
577 |
case MP_TREES: |
|
578 |
if ((_map2[TILE_ADDXY(tile, 1, 0)] & 0x30) == 0x20) |
|
579 |
img_2 = 1; |
|
580 |
else |
|
581 |
img_2 = 0; |
|
582 |
break; |
|
583 |
||
584 |
default: |
|
585 |
img_2 = 0; |
|
586 |
break; |
|
0 | 587 |
} |
588 |
||
1293 | 589 |
if ((_map3_hi[tile] & 0xE0) == 0) { |
590 |
if ((img_1 & 2) != (img_2 & 2)) { |
|
0 | 591 |
_map3_hi[tile] |= 3 << 5; |
592 |
dirty = tile; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
593 |
} |
0 | 594 |
} else { |
595 |
if (img_1 == 1 && img_2 == 1) { |
|
596 |
_map3_hi[tile] &= ~(3 << 5); |
|
597 |
dirty = tile; |
|
598 |
} |
|
599 |
} |
|
600 |
||
1293 | 601 |
switch (GetTileType(TILE_ADDXY(tile, 0, 1))) { |
602 |
case MP_CLEAR: |
|
1298 | 603 |
img_2 = img_by_map5[(_map5[TILE_ADDXY(tile, 0, 1)] & 0x1C) >> 2]; |
1293 | 604 |
break; |
605 |
||
606 |
case MP_TREES: |
|
607 |
if ((_map2[TILE_ADDXY(tile, 0, 1)] & 0x30) == 0x20) |
|
608 |
img_2 = 1; |
|
609 |
else |
|
610 |
img_2 = 0; |
|
611 |
break; |
|
612 |
||
613 |
default: |
|
614 |
img_2 = 0; |
|
615 |
break; |
|
0 | 616 |
} |
617 |
||
1293 | 618 |
if ((_map3_hi[tile] & 0x1C) == 0) { |
619 |
if ((img_1 & 2) != (img_2 & 2)) { |
|
0 | 620 |
_map3_hi[tile] |= 3 << 2; |
621 |
dirty = tile; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
622 |
} |
0 | 623 |
} else { |
624 |
if (img_1 == 1 && img_2 == 1) { |
|
625 |
_map3_hi[tile] &= ~(3 << 2); |
|
626 |
dirty = tile; |
|
627 |
} |
|
628 |
} |
|
629 |
||
1293 | 630 |
if (dirty != INVALID_TILE) |
0 | 631 |
MarkTileDirtyByTile(dirty); |
632 |
} |
|
633 |
||
634 |
||
635 |
/* convert into snowy tiles */ |
|
636 |
static void TileLoopClearAlps(uint tile) |
|
637 |
{ |
|
638 |
int k; |
|
639 |
byte m5,tmp; |
|
640 |
||
641 |
/* distance from snow line, in steps of 8 */ |
|
642 |
k = GetTileZ(tile) - _opt.snow_line; |
|
643 |
||
644 |
m5 = _map5[tile] & 0x1C; |
|
645 |
tmp = _map5[tile] & 3; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
646 |
|
0 | 647 |
if (k < -8) { |
648 |
/* snow_m2_down */ |
|
649 |
if (m5 != 0x10) |
|
650 |
return; |
|
651 |
if (tmp == 0) |
|
652 |
m5 = 3; |
|
653 |
} else if (k == -8) { |
|
654 |
/* snow_m1 */ |
|
655 |
if (m5 != 0x10) { |
|
656 |
m5 = 0x10; |
|
657 |
} else if (tmp != 0) { |
|
658 |
m5 = (tmp - 1) + 0x10; |
|
659 |
} else |
|
660 |
return; |
|
661 |
} else if (k < 8) { |
|
662 |
/* snow_0 */ |
|
663 |
if (m5 != 0x10) { |
|
664 |
m5 = 0x10; |
|
665 |
} else if (tmp != 1) { |
|
666 |
m5 = 1; |
|
667 |
if (tmp != 0) |
|
668 |
m5 = tmp - 1; |
|
669 |
m5 += 0x10; |
|
670 |
} else |
|
671 |
return; |
|
672 |
} else if (k == 8) { |
|
673 |
/* snow_p1 */ |
|
674 |
if (m5 != 0x10) { |
|
675 |
m5 = 0x10; |
|
676 |
} else if (tmp != 2) { |
|
677 |
m5 = 2; |
|
678 |
if (tmp <= 2) |
|
679 |
m5 = tmp + 1; |
|
680 |
m5 += 0x10; |
|
681 |
} else |
|
682 |
return; |
|
683 |
} else { |
|
684 |
/* snow_p2_up */ |
|
685 |
if (m5 != 0x10) { |
|
686 |
m5 = 0x10; |
|
687 |
} else if (tmp != 3) { |
|
688 |
m5 = tmp + 1 + 0x10; |
|
689 |
} else |
|
690 |
return; |
|
691 |
} |
|
692 |
||
693 |
_map5[tile] = m5; |
|
694 |
MarkTileDirtyByTile(tile); |
|
695 |
} |
|
696 |
||
697 |
static void TileLoopClearDesert(uint tile) |
|
698 |
{ |
|
699 |
if ( (_map5[tile] & 0x1C) == 0x14) |
|
700 |
return; |
|
701 |
||
702 |
if (GetMapExtraBits(tile) == 1) { |
|
703 |
_map5[tile] = 0x17; |
|
704 |
} else { |
|
705 |
if (GetMapExtraBits(tile+TILE_XY(1,0)) != 1 && |
|
706 |
GetMapExtraBits(tile+TILE_XY(-1,0)) != 1 && |
|
707 |
GetMapExtraBits(tile+TILE_XY(0,1)) != 1 && |
|
708 |
GetMapExtraBits(tile+TILE_XY(0,-1)) != 1) |
|
709 |
return; |
|
710 |
_map5[tile] = 0x15; |
|
711 |
} |
|
712 |
||
713 |
MarkTileDirtyByTile(tile); |
|
714 |
} |
|
715 |
||
716 |
static void TileLoop_Clear(uint tile) |
|
717 |
{ |
|
718 |
byte m5,m3; |
|
719 |
||
720 |
TileLoopClearHelper(tile); |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
721 |
|
0 | 722 |
if (_opt.landscape == LT_DESERT) { |
723 |
TileLoopClearDesert(tile); |
|
724 |
} else if (_opt.landscape == LT_HILLY) { |
|
725 |
TileLoopClearAlps(tile); |
|
726 |
} |
|
727 |
||
728 |
m5 = _map5[tile]; |
|
729 |
if ( (m5 & 0x1C) == 0x10 || (m5 & 0x1C) == 0x14) |
|
730 |
return; |
|
731 |
||
732 |
if ( (m5 & 0x1C) != 0xC) { |
|
733 |
if ( (m5 & 3) == 3) |
|
734 |
return; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
735 |
|
0 | 736 |
if (_game_mode != GM_EDITOR) { |
737 |
m5 += 0x20; |
|
738 |
if (m5 >= 0x20) { |
|
739 |
// Didn't overflow |
|
740 |
_map5[tile] = m5; |
|
741 |
return; |
|
742 |
} |
|
743 |
/* did overflow, so continue */ |
|
744 |
} else { |
|
745 |
m5 = ((byte)Random() > 21) ? (2) : (6); |
|
746 |
} |
|
747 |
m5++; |
|
748 |
} else if (_game_mode != GM_EDITOR) { |
|
749 |
/* handle farm field */ |
|
750 |
m5 += 0x20; |
|
751 |
if (m5 >= 0x20) { |
|
752 |
// Didn't overflow |
|
753 |
_map5[tile] = m5; |
|
754 |
return; |
|
755 |
} |
|
756 |
/* overflowed */ |
|
757 |
m3 = _map3_lo[tile] + 1; |
|
758 |
assert( (m3 & 0xF) != 0); |
|
759 |
if ( (m3 & 0xF) >= 9) /* NOTE: will not work properly if m3&0xF == 0xF */ |
|
760 |
m3 &= ~0xF; |
|
761 |
_map3_lo[tile] = m3; |
|
762 |
} |
|
763 |
||
764 |
_map5[tile] = m5; |
|
765 |
MarkTileDirtyByTile(tile); |
|
766 |
} |
|
767 |
||
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1059
diff
changeset
|
768 |
void GenerateClearTile(void) |
0 | 769 |
{ |
770 |
int i,j; |
|
771 |
uint tile,tile_new; |
|
772 |
uint32 r; |
|
773 |
||
774 |
/* add hills */ |
|
1202
4d2a20c50760
(svn r1706) Implement ScaleByMapSize() and ScaleByMapSize1D()
tron
parents:
1130
diff
changeset
|
775 |
i = ScaleByMapSize((Random() & 0x3FF) + 0x400); |
0 | 776 |
do { |
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
777 |
tile = TILE_MASK(Random()); |
1035
812f837ee03f
(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
|
778 |
if (IsTileType(tile, MP_CLEAR)) |
0 | 779 |
_map5[tile] = (byte)((_map5[tile] & ~(3<<2)) | (1<<2)); |
780 |
} while (--i); |
|
781 |
||
782 |
/* add grey squares */ |
|
1202
4d2a20c50760
(svn r1706) Implement ScaleByMapSize() and ScaleByMapSize1D()
tron
parents:
1130
diff
changeset
|
783 |
i = ScaleByMapSize((Random() & 0x7F) + 0x80); |
0 | 784 |
do { |
785 |
r = Random(); |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
159
diff
changeset
|
786 |
tile = TILE_MASK(r); |
1035
812f837ee03f
(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
|
787 |
if (IsTileType(tile, MP_CLEAR)) { |
0 | 788 |
j = ((r >> 16) & 0xF) + 5; |
789 |
for(;;) { |
|
790 |
_map5[tile] = (byte)((_map5[tile] & ~(3<<2)) | (2<<2)); |
|
791 |
do { |
|
792 |
if (--j == 0) goto get_out; |
|
900 | 793 |
tile_new = tile + TileOffsByDir(Random() & 3); |
1035
812f837ee03f
(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
|
794 |
} while (!IsTileType(tile_new, MP_CLEAR)); |
0 | 795 |
tile = tile_new; |
796 |
} |
|
797 |
get_out:; |
|
798 |
} |
|
799 |
} while (--i); |
|
800 |
} |
|
801 |
||
802 |
static void ClickTile_Clear(uint tile) |
|
803 |
{ |
|
804 |
/* not used */ |
|
805 |
} |
|
806 |
||
410 | 807 |
static uint32 GetTileTrackStatus_Clear(uint tile, TransportType mode) |
0 | 808 |
{ |
809 |
return 0; |
|
810 |
} |
|
811 |
||
812 |
static const StringID _clear_land_str[4+8-1] = { |
|
813 |
STR_080B_ROUGH_LAND, |
|
814 |
STR_080A_ROCKS, |
|
815 |
STR_080E_FIELDS, |
|
816 |
STR_080F_SNOW_COVERED_LAND, |
|
817 |
STR_0810_DESERT, |
|
818 |
0, |
|
819 |
0, |
|
820 |
STR_080C_BARE_LAND, |
|
821 |
STR_080D_GRASS, |
|
822 |
STR_080D_GRASS, |
|
823 |
STR_080D_GRASS, |
|
824 |
}; |
|
825 |
||
826 |
static void GetTileDesc_Clear(uint tile, TileDesc *td) |
|
827 |
{ |
|
828 |
int i = (_map5[tile]>>2) & 7; |
|
829 |
if (i == 0) |
|
830 |
i = (_map5[tile] & 3) + 8; |
|
831 |
td->str = _clear_land_str[i - 1]; |
|
832 |
td->owner = _map_owner[tile]; |
|
833 |
} |
|
834 |
||
835 |
static void ChangeTileOwner_Clear(uint tile, byte old_player, byte new_player) |
|
836 |
{ |
|
837 |
return; |
|
838 |
} |
|
839 |
||
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1059
diff
changeset
|
840 |
void InitializeClearLand(void) |
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
1059
diff
changeset
|
841 |
{ |
0 | 842 |
_opt.snow_line = _patches.snow_line_height * 8; |
843 |
} |
|
844 |
||
845 |
const TileTypeProcs _tile_type_clear_procs = { |
|
846 |
DrawTile_Clear, /* draw_tile_proc */ |
|
847 |
GetSlopeZ_Clear, /* get_slope_z_proc */ |
|
848 |
ClearTile_Clear, /* clear_tile_proc */ |
|
849 |
GetAcceptedCargo_Clear, /* get_accepted_cargo_proc */ |
|
850 |
GetTileDesc_Clear, /* get_tile_desc_proc */ |
|
851 |
GetTileTrackStatus_Clear, /* get_tile_track_status_proc */ |
|
852 |
ClickTile_Clear, /* click_tile_proc */ |
|
853 |
AnimateTile_Clear, /* animate_tile_proc */ |
|
854 |
TileLoop_Clear, /* tile_loop_clear */ |
|
855 |
ChangeTileOwner_Clear, /* change_tile_owner_clear */ |
|
856 |
NULL, /* get_produced_cargo_proc */ |
|
857 |
NULL, /* vehicle_enter_tile_proc */ |
|
858 |
NULL, /* vehicle_leave_tile_proc */ |
|
39 | 859 |
GetSlopeTileh_Clear, /* get_slope_tileh_proc */ |
0 | 860 |
}; |