mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-11 18:10:14 +00:00
(svn r11843) -Fix: mark dirty canal tile even in diagonal direction from flooded tile
This commit is contained in:
parent
933aea42cb
commit
311c14c9f5
@ -30,6 +30,9 @@ enum Direction {
|
|||||||
INVALID_DIR = 0xFF, ///< Flag for an invalid direction
|
INVALID_DIR = 0xFF, ///< Flag for an invalid direction
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Allow incrementing of Direction variables */
|
||||||
|
DECLARE_POSTFIX_INCREMENT(Direction);
|
||||||
|
|
||||||
/** Define basic enum properties */
|
/** Define basic enum properties */
|
||||||
template <> struct EnumPropsT<Direction> : MakeEnumPropsT<Direction, byte, DIR_BEGIN, DIR_END, INVALID_DIR> {};
|
template <> struct EnumPropsT<Direction> : MakeEnumPropsT<Direction, byte, DIR_BEGIN, DIR_END, INVALID_DIR> {};
|
||||||
typedef TinyEnumT<Direction> DirectionByte; //typedefing-enumification of Direction
|
typedef TinyEnumT<Direction> DirectionByte; //typedefing-enumification of Direction
|
||||||
@ -77,6 +80,7 @@ enum DiagDirection {
|
|||||||
INVALID_DIAGDIR = 0xFF, ///< Flag for an invalid DiagDirection
|
INVALID_DIAGDIR = 0xFF, ///< Flag for an invalid DiagDirection
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** Allow incrementing of DiagDirection variables */
|
||||||
DECLARE_POSTFIX_INCREMENT(DiagDirection);
|
DECLARE_POSTFIX_INCREMENT(DiagDirection);
|
||||||
|
|
||||||
/** Define basic enum properties */
|
/** Define basic enum properties */
|
||||||
|
@ -644,10 +644,9 @@ static void TileLoopWaterHelper(TileIndex tile, const TileIndexDiffC *offs)
|
|||||||
MakeWater(target);
|
MakeWater(target);
|
||||||
MarkTileDirtyByTile(target);
|
MarkTileDirtyByTile(target);
|
||||||
/* Mark surrounding canal tiles dirty too to avoid glitches */
|
/* Mark surrounding canal tiles dirty too to avoid glitches */
|
||||||
MarkTileDirtyIfCanal(target + TileDiffXY(0, 1));
|
for (Direction dir = DIR_BEGIN; dir < DIR_END; dir++) {
|
||||||
MarkTileDirtyIfCanal(target + TileDiffXY(1, 0));
|
MarkTileDirtyIfCanal(target + TileOffsByDir(dir));
|
||||||
MarkTileDirtyIfCanal(target + TileDiffXY(0, -1));
|
}
|
||||||
MarkTileDirtyIfCanal(target + TileDiffXY(-1, 0));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user