Implement new shortened train flipping for template trains

This commit is contained in:
Jonathan G Rennison
2022-12-27 02:12:29 +00:00
parent 5bea50c413
commit 4df56ec1ef
2 changed files with 9 additions and 0 deletions

View File

@@ -61,6 +61,11 @@ void TemplateVehicleImageDimensions::SetFromTrain(const Train *t)
this->reference_width = e->GetGRF()->traininfo_vehicle_width;
this->vehicle_pitch = e->GetGRF()->traininfo_vehicle_pitch;
}
if (t->gcache.cached_veh_length != 8 && HasBit(t->flags, VRF_REVERSE_DIRECTION) && !HasBit(EngInfo(t->engine_type)->misc_flags, EF_RAIL_FLIPS)) {
this->vehicle_flip_length = t->gcache.cached_veh_length;
} else {
this->vehicle_flip_length = -1;
}
}
TemplateVehicle::TemplateVehicle(VehicleType ty, EngineID eid, byte subtypeflag, Owner current_owner)