summaryrefslogtreecommitdiff
path: root/clear_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-02-06 09:18:04 +0000
committertron <tron@openttd.org>2006-02-06 09:18:04 +0000
commit453b30e387f8d8ab1839d96b0d1f9a8fea841292 (patch)
tree3a4002304d8204d11c37ba706d6ffbd2e5dfac1b /clear_cmd.c
parent0755bbead0240f519c9d78bb88ef4629d5ab8fa5 (diff)
downloadopenttd-453b30e387f8d8ab1839d96b0d1f9a8fea841292.tar.xz
(svn r3564) Several smaller changes:
- Don't treat non-booleans as booleans - Reduce variable scope - Bracing - Use DeMorgan's law to make conditionals easier to read - if cascade -> switch - Replace some magic numbers by symbolic names - Avoid assignments within other statements
Diffstat (limited to 'clear_cmd.c')
-rw-r--r--clear_cmd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/clear_cmd.c b/clear_cmd.c
index 31d130b23..8577761be 100644
--- a/clear_cmd.c
+++ b/clear_cmd.c
@@ -637,10 +637,9 @@ static void TileLoop_Clear(TileIndex tile)
{
TileLoopClearHelper(tile);
- if (_opt.landscape == LT_DESERT) {
- TileLoopClearDesert(tile);
- } else if (_opt.landscape == LT_HILLY) {
- TileLoopClearAlps(tile);
+ switch (_opt.landscape) {
+ case LT_DESERT: TileLoopClearDesert(tile); break;
+ case LT_HILLY: TileLoopClearAlps(tile); break;
}
switch (GetClearGround(tile)) {