mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-24 06:59:10 +00:00
(svn r10280) [0.5] -Backport from trunk (r10109, r10219, r10222, r10230, r10246, r10258):
- Fix: Do not look in every direction for tunnels when building one, one direction is enough (r10258) - Fix: Take the age of the front vehicle for station rating (r10246) - Fix: Terraforming wipes out canals. Now you always have to remove the canal before terraforming, instead of "just" removing the canal [FS#594] (r10240) - Fix: Only 2 trains could crash at one time as collision checking stopped on the first hit. This could technically cause desyncs in network games as the collision hash order is not guaranteed [FS#892] (r10222) - Fix: Land under foundations was terraform when it shouldn't be terraformed [FS#882, FS#890] (r10219) - Fix: Some NewGRFs use the same (unused in the "current" climate) sprite IDs. Normally this gives some artefacts, but when one NewGRF expects it to be a sprite and another NewGRF overwrites it with a non-sprite nasty things happen (drawing a non-sprite crashes OTTD) [FS#838] (r10109)
This commit is contained in:
10
clear_cmd.c
10
clear_cmd.c
@@ -17,6 +17,7 @@
|
||||
#include "unmovable_map.h"
|
||||
#include "genworld.h"
|
||||
#include "industry.h"
|
||||
#include "water_map.h"
|
||||
|
||||
typedef struct TerraformerHeightMod {
|
||||
TileIndex tile;
|
||||
@@ -111,7 +112,7 @@ static int TerraformProc(TerraformerState *ts, TileIndex tile, int mode)
|
||||
// basement and then you raise/lower the other corner.
|
||||
tileh = GetTileSlope(tile, &z);
|
||||
if (tileh == unsafe_slope[mode] ||
|
||||
tileh == ComplementSlope(unsafe_slope[mode])) {
|
||||
tileh == (SLOPE_STEEP | ComplementSlope(unsafe_slope[mode]))) {
|
||||
_terraform_err_tile = tile;
|
||||
_error_message = STR_1008_MUST_REMOVE_RAILROAD_TRACK;
|
||||
return -1;
|
||||
@@ -136,6 +137,13 @@ static int TerraformProc(TerraformerState *ts, TileIndex tile, int mode)
|
||||
}
|
||||
}
|
||||
|
||||
/* Canals can't be terraformed */
|
||||
if (IsClearWaterTile(tile) && IsCanal(tile)) {
|
||||
_terraform_err_tile = tile;
|
||||
_error_message = STR_MUST_DEMOLISH_CANAL_FIRST;
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = DoCommand(tile, 0,0, ts->flags & ~DC_EXEC, CMD_LANDSCAPE_CLEAR);
|
||||
|
||||
if (CmdFailed(ret)) {
|
||||
|
Reference in New Issue
Block a user