diff options
author | tron <tron@openttd.org> | 2005-03-06 12:33:33 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-03-06 12:33:33 +0000 |
commit | a4a09e73d553e3d7baf67061360c23266406301c (patch) | |
tree | 99aa9be6aabbabf7e9c3106e78316a1000cfcd7c | |
parent | a747e2bb97134d9f65de06b4418aa3bb55adcec1 (diff) | |
download | openttd-a4a09e73d553e3d7baf67061360c23266406301c.tar.xz |
(svn r1935) Missing braces; while here turn the ifs into a single switch
-rw-r--r-- | train_cmd.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/train_cmd.c b/train_cmd.c index 645a84e6c..24faef274 100644 --- a/train_cmd.c +++ b/train_cmd.c @@ -2640,12 +2640,22 @@ static void DeleteLastWagon(Vehicle *v) if (endtile == INVALID_TILE) // tunnel is busy (error returned) return; - if ((v->direction == 1) || (v->direction == 5) ) - SetSignalsOnBothDir(v->tile, 0); - SetSignalsOnBothDir(endtile, 0); - if ((v->direction == 3) || (v->direction == 7) ) - SetSignalsOnBothDir(v->tile, 1); - SetSignalsOnBothDir(endtile, 1); + switch (v->direction) { + case 1: + case 5: + SetSignalsOnBothDir(v->tile, 0); + SetSignalsOnBothDir(endtile, 0); + break; + + case 3: + case 7: + SetSignalsOnBothDir(v->tile, 1); + SetSignalsOnBothDir(endtile, 1); + break; + + default: + break; + } } } |