diff src/vehicle.cpp @ 5993:2498be7c7e94 draft

(svn r8701) -Codechange: replace magic numbers with enums for u.rail.track.
author rubidium <rubidium@openttd.org>
date Tue, 13 Feb 2007 10:46:45 +0000
parents 1b793d99b5ba
children 2f43f0d4d589
line wrap: on
line diff
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -2316,7 +2316,7 @@
 	switch (type) {
 		case VEH_Train:
 			FOR_ALL_VEHICLES(v) {
-				if (v->tile == tile && v->type == VEH_Train && v->u.rail.track == 0x80) {
+				if (v->tile == tile && v->type == VEH_Train && v->u.rail.track == TRACK_BIT_DEPOT) {
 					if (IsFrontEngine(v)) {
 						if (engine_list == NULL) continue;
 						if (*engine_count == *engine_list_length) ExtendVehicleListSize((const Vehicle***)engine_list, engine_list_length, 25);
@@ -2529,7 +2529,7 @@
 
 		case VEH_Ship:
 			InvalidateWindowClasses(WC_SHIPS_LIST);
-			v->u.ship.state = TRACK_BIT_SPECIAL;
+			v->u.ship.state = TRACK_BIT_DEPOT;
 			RecalcShipStuff(v);
 			break;
 
@@ -2737,10 +2737,10 @@
 
 	switch (v->type) {
 		case VEH_Train:
-			if (v->u.rail.track == 0x80) /* We'll assume the train is facing outwards */
+			if (v->u.rail.track == TRACK_BIT_DEPOT) /* We'll assume the train is facing outwards */
 				return DiagdirToDiagTrackdir(GetRailDepotDirection(v->tile)); /* Train in depot */
 
-			if (v->u.rail.track == 0x40) /* train in tunnel, so just use his direction and assume a diagonal track */
+			if (v->u.rail.track == TRACK_BIT_WORMHOLE) /* train in tunnel, so just use his direction and assume a diagonal track */
 				return DiagdirToDiagTrackdir(DirToDiagDir(v->direction));
 
 			return TrackDirectionToTrackdir(FindFirstTrack(v->u.rail.track), v->direction);