summaryrefslogtreecommitdiff
path: root/src/clear_map.h
diff options
context:
space:
mode:
authormaedhros <maedhros@openttd.org>2007-01-09 21:43:32 +0000
committermaedhros <maedhros@openttd.org>2007-01-09 21:43:32 +0000
commite221fef08c55a401620b3f63c6fa766bcfabe406 (patch)
tree250dd64829f92f11a4a3061b54ee146d3f8d12eb /src/clear_map.h
parent6c3187213d174617ddbd89b2c70da86f71c5f906 (diff)
downloadopenttd-e221fef08c55a401620b3f63c6fa766bcfabe406.tar.xz
(svn r8014) -Codechange (r7573): When a tile is cleared, empty the general purpose bits in
extra as well, unless they are (or could be) used for bridges. This means these bits don't have to be cleared seperately when non-bridgeable tiles are removed.
Diffstat (limited to 'src/clear_map.h')
-rw-r--r--src/clear_map.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/clear_map.h b/src/clear_map.h
index 50ae63b1b..85c52a1a7 100644
--- a/src/clear_map.h
+++ b/src/clear_map.h
@@ -5,6 +5,7 @@
#include "macros.h"
#include "tile.h"
+#include "bridge_map.h"
/* ground type, m5 bits 2...4
* valid densities (bits 0...1) in comments after the enum
@@ -123,12 +124,17 @@ static inline void SetFenceSW(TileIndex t, uint h)
static inline void MakeClear(TileIndex t, ClearGround g, uint density)
{
+ /* If this is a non-bridgeable tile, clear the bridge bits while the rest
+ * of the tile information is still here. */
+ if (!MayHaveBridgeAbove(t)) SB(_m[t].extra, 6, 2, 0);
+
SetTileType(t, MP_CLEAR);
SetTileOwner(t, OWNER_NONE);
_m[t].m2 = 0;
_m[t].m3 = 0;
_m[t].m4 = 0 << 5 | 0 << 2;
SetClearGroundDensity(t, g, density);
+ SB(_m[t].extra, 2, 4, 0);
}