summaryrefslogtreecommitdiff
path: root/src/vehicle.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-01-30 11:53:35 +0000
committerbelugas <belugas@openttd.org>2007-01-30 11:53:35 +0000
commit0c45071bb018aab652f81b594cffa5b2c4ded0d4 (patch)
treed001f734f6111d6fe12abd4a122d09903325335c /src/vehicle.cpp
parente3b63e6d8327b800a2d318d8f30ef72f3b39f33e (diff)
downloadopenttd-0c45071bb018aab652f81b594cffa5b2c4ded0d4.tar.xz
(svn r8455) -Codechange: Give a more meaningful name (railveh_type)to member flags of RailVehInfo, as well as changing the code to reflect the fact that it was not a flag but rather a one value only variable. Doing so, some evaluations have been simplified.
-Codechange: Add and use RAILVEH_SINGLEHEAD when railveh_type is set to 0, which was implicit before. -Cleanup: Remove some extraneous parenthesis.
Diffstat (limited to 'src/vehicle.cpp')
-rw-r--r--src/vehicle.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index ab45f792f..cdaea63aa 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -787,7 +787,7 @@ int32 GetRefitCost(EngineID engine_type)
case VEH_Road: base_cost = _price.roadveh_base; break;
case VEH_Aircraft: base_cost = _price.aircraft_base; break;
case VEH_Train:
- base_cost = 2 * ((RailVehInfo(engine_type)->flags & RVI_WAGON) ?
+ base_cost = 2 * ((RailVehInfo(engine_type)->railveh_type == RAILVEH_WAGON) ?
_price.build_railwagon : _price.build_railvehicle);
break;
default: NOT_REACHED(); break;
@@ -2243,7 +2243,7 @@ static int32 MaybeReplaceVehicle(Vehicle *v, bool check, bool display_costs)
while (v->u.rail.cached_total_length > old_total_length) {
// the train is too long. We will remove cars one by one from the start of the train until it's short enough
- while (w != NULL && !(RailVehInfo(w->engine_type)->flags&RVI_WAGON) ) {
+ while (w != NULL && RailVehInfo(w->engine_type)->railveh_type != RAILVEH_WAGON) {
w = GetNextVehicle(w);
}
if (w == NULL) {
@@ -2850,7 +2850,7 @@ static SpriteID GetEngineColourMap(EngineID engine_type, PlayerID player, Engine
case RAILTYPE_ELECTRIC:
{
if (cargo_type == CT_INVALID) cargo_type = rvi->cargo_type;
- if (rvi->flags & RVI_WAGON) {
+ if (rvi->railveh_type == RAILVEH_WAGON) {
if (cargo_type == CT_PASSENGERS || cargo_type == CT_MAIL || cargo_type == CT_VALUABLES) {
if (parent_engine_type == INVALID_ENGINE) {
scheme = LS_PASSENGER_WAGON_STEAM;