summaryrefslogtreecommitdiff
path: root/unmovable_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-21 20:02:05 +0000
committertron <tron@openttd.org>2006-03-21 20:02:05 +0000
commit4d3364d8118dbadaacc0cc607a24ff525d24a173 (patch)
tree3dd764e9709bc9811e7667a7182d82eb843bfa22 /unmovable_cmd.c
parent4b86230d94d812c787f952e0892ad4670e67bf35 (diff)
downloadopenttd-4d3364d8118dbadaacc0cc607a24ff525d24a173.tar.xz
(svn r3996) -Fix: Slope and height information returned for some tile types is wrong
This leads to graphical glitches when drawing foundations. This doesn't fix all problems, but at least some of them.
Diffstat (limited to 'unmovable_cmd.c')
-rw-r--r--unmovable_cmd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/unmovable_cmd.c b/unmovable_cmd.c
index 3798265ec..23e11ab50 100644
--- a/unmovable_cmd.c
+++ b/unmovable_cmd.c
@@ -184,12 +184,16 @@ static void DrawTile_Unmovable(TileInfo *ti)
static uint GetSlopeZ_Unmovable(const TileInfo* ti)
{
- return GetPartialZ(ti->x & 0xF, ti->y & 0xF, ti->tileh) + ti->z;
+ if (_m[ti->tile].m5 == 3) {
+ return ti->z + GetPartialZ(ti->x & 0xF, ti->y & 0xF, ti->tileh);
+ } else {
+ return ti->z + (ti->tileh == 0 ? 0 : 8);
+ }
}
static uint GetSlopeTileh_Unmovable(const TileInfo *ti)
{
- return 0;
+ return _m[ti->tile].m5 == 3 ? ti->tileh : 0;
}
static int32 ClearTile_Unmovable(TileIndex tile, byte flags)