(svn r1935) Missing braces; while here turn the ifs into a single switch
authortron
Sun, 06 Mar 2005 12:33:33 +0000
changeset 1431 93ab62952062
parent 1430 68847f67a412
child 1432 9086ccebb3f1
(svn r1935) Missing braces; while here turn the ifs into a single switch
train_cmd.c
--- a/train_cmd.c	Sun Mar 06 12:31:07 2005 +0000
+++ b/train_cmd.c	Sun Mar 06 12:33:33 2005 +0000
@@ -2640,12 +2640,22 @@
 		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;
+		}
 	}
 }