(svn r11800) -Codechange: move some functions to a more logical location + some type safety.

This commit is contained in:
rubidium
2008-01-09 21:05:03 +00:00
parent a5101fb403
commit 2d2e1e3863
30 changed files with 220 additions and 151 deletions

View File

@@ -165,7 +165,7 @@ void TrainConsistChanged(Vehicle* v)
const RailVehicleInfo *rvi_v = RailVehInfo(v->engine_type);
EngineID first_engine = IsFrontEngine(v) ? v->engine_type : INVALID_ENGINE;
v->u.rail.cached_total_length = 0;
v->u.rail.compatible_railtypes = 0;
v->u.rail.compatible_railtypes = RAILTYPES_NONE;
bool train_can_tilt = true;
@@ -230,7 +230,7 @@ void TrainConsistChanged(Vehicle* v)
* existing electric engines when elrails are disabled and then re-enabled */
if (HasBit(u->u.rail.flags, VRF_EL_ENGINE_ALLOWED_NORMAL_RAIL)) {
u->u.rail.railtype = RAILTYPE_RAIL;
u->u.rail.compatible_railtypes |= (1 << RAILTYPE_RAIL);
u->u.rail.compatible_railtypes |= RAILTYPES_RAIL;
}
/* max speed is the minimum of the speed limits of all vehicles in the consist */