@@ -708,51 +708,52 @@ public virtual void LoadFromWagFile(string wagFilePath)
708708
709709 }
710710
711+ void setIfPositive ( ref float result , float ? value ) { if ( value > 0 ) result = ( float ) value ; }
711712 void setIfNonZero ( ref float result , float ? value ) { if ( value != null && value != 0 ) result = ( float ) value ; }
712713
713714 // Read freight animation values from animation INCLUDE files
714715 // Read (initialise) "common" (empty values first).
715716 // Test each value to make sure that it has been defined in the WAG file, if not default to Root WAG file value
716- setIfNonZero ( ref LoadEmptyMassKg , FreightAnimations . WagonEmptyWeight ) ;
717- setIfNonZero ( ref LoadEmptyORTSDavis_A , FreightAnimations . EmptyORTSDavis_A ) ;
718- setIfNonZero ( ref LoadEmptyORTSDavis_B , FreightAnimations . EmptyORTSDavis_B ) ;
719- setIfNonZero ( ref LoadEmptyORTSDavis_C , FreightAnimations . EmptyORTSDavis_C ) ;
720- setIfNonZero ( ref LoadEmptyDavisDragConstant , FreightAnimations . EmptyORTSDavisDragConstant ) ;
721- setIfNonZero ( ref LoadEmptyWagonFrontalAreaM2 , FreightAnimations . EmptyORTSWagonFrontalAreaM2 ) ;
722- setIfNonZero ( ref LoadEmptyMaxBrakeForceN , FreightAnimations . EmptyMaxBrakeShoeForceN ) ;
723- setIfNonZero ( ref LoadEmptyMaxBrakeForceN , FreightAnimations . EmptyMaxBrakeForceN ) ;
724- setIfNonZero ( ref LoadEmptyMaxHandbrakeForceN , FreightAnimations . EmptyMaxHandbrakeForceN ) ;
725- setIfNonZero ( ref LoadEmptyCentreOfGravityM_Y , FreightAnimations . EmptyCentreOfGravityM_Y ) ;
726- setIfNonZero ( ref LoadEmptyRelayValveRatio , FreightAnimations . EmptyRelayValveRatio ) ;
717+ setIfPositive ( ref LoadEmptyMassKg , FreightAnimations . WagonEmptyWeight ) ;
718+ setIfPositive ( ref LoadEmptyORTSDavis_A , FreightAnimations . EmptyORTSDavis_A ) ;
719+ setIfPositive ( ref LoadEmptyORTSDavis_B , FreightAnimations . EmptyORTSDavis_B ) ;
720+ setIfPositive ( ref LoadEmptyORTSDavis_C , FreightAnimations . EmptyORTSDavis_C ) ;
721+ setIfPositive ( ref LoadEmptyDavisDragConstant , FreightAnimations . EmptyORTSDavisDragConstant ) ;
722+ setIfPositive ( ref LoadEmptyWagonFrontalAreaM2 , FreightAnimations . EmptyORTSWagonFrontalAreaM2 ) ;
723+ setIfPositive ( ref LoadEmptyMaxBrakeForceN , FreightAnimations . EmptyMaxBrakeShoeForceN ) ;
724+ setIfPositive ( ref LoadEmptyMaxBrakeForceN , FreightAnimations . EmptyMaxBrakeForceN ) ;
725+ setIfPositive ( ref LoadEmptyMaxHandbrakeForceN , FreightAnimations . EmptyMaxHandbrakeForceN ) ;
726+ setIfPositive ( ref LoadEmptyCentreOfGravityM_Y , FreightAnimations . EmptyCentreOfGravityM_Y ) ;
727+ setIfPositive ( ref LoadEmptyRelayValveRatio , FreightAnimations . EmptyRelayValveRatio ) ;
727728 setIfNonZero ( ref LoadEmptyInshotPSI , FreightAnimations . EmptyInshotPSI ) ;
728729
729730 // Read (initialise) Static load ones if a static load
730731 // Test each value to make sure that it has been defined in the WAG file, if not default to Root WAG file value
731- setIfNonZero ( ref LoadFullORTSDavis_A , FreightAnimations . FullPhysicsStaticOne ? . FullStaticORTSDavis_A ) ;
732- setIfNonZero ( ref LoadFullORTSDavis_B , FreightAnimations . FullPhysicsStaticOne ? . FullStaticORTSDavis_B ) ;
733- setIfNonZero ( ref LoadFullORTSDavis_C , FreightAnimations . FullPhysicsStaticOne ? . FullStaticORTSDavis_C ) ;
734- setIfNonZero ( ref LoadFullDavisDragConstant , FreightAnimations . FullPhysicsStaticOne ? . FullStaticORTSDavisDragConstant ) ;
735- setIfNonZero ( ref LoadFullWagonFrontalAreaM2 , FreightAnimations . FullPhysicsStaticOne ? . FullStaticORTSWagonFrontalAreaM2 ) ;
736- setIfNonZero ( ref LoadFullMaxBrakeForceN , FreightAnimations . FullPhysicsStaticOne ? . FullStaticMaxBrakeShoeForceN ) ;
737- setIfNonZero ( ref LoadFullMaxBrakeForceN , FreightAnimations . FullPhysicsStaticOne ? . FullStaticMaxBrakeForceN ) ;
738- setIfNonZero ( ref LoadFullMaxHandbrakeForceN , FreightAnimations . FullPhysicsStaticOne ? . FullStaticMaxHandbrakeForceN ) ;
739- setIfNonZero ( ref LoadFullCentreOfGravityM_Y , FreightAnimations . FullPhysicsStaticOne ? . FullStaticCentreOfGravityM_Y ) ;
740- setIfNonZero ( ref LoadFullRelayValveRatio , FreightAnimations . FullPhysicsStaticOne ? . FullStaticRelayValveRatio ) ;
741- setIfNonZero ( ref LoadFullInshotPSI , FreightAnimations . FullPhysicsStaticOne ? . FullStaticInshotPSI ) ;
732+ setIfPositive ( ref LoadFullORTSDavis_A , FreightAnimations . FullPhysicsStaticOne ? . FullStaticORTSDavis_A ) ;
733+ setIfPositive ( ref LoadFullORTSDavis_B , FreightAnimations . FullPhysicsStaticOne ? . FullStaticORTSDavis_B ) ;
734+ setIfPositive ( ref LoadFullORTSDavis_C , FreightAnimations . FullPhysicsStaticOne ? . FullStaticORTSDavis_C ) ;
735+ setIfPositive ( ref LoadFullDavisDragConstant , FreightAnimations . FullPhysicsStaticOne ? . FullStaticORTSDavisDragConstant ) ;
736+ setIfPositive ( ref LoadFullWagonFrontalAreaM2 , FreightAnimations . FullPhysicsStaticOne ? . FullStaticORTSWagonFrontalAreaM2 ) ;
737+ setIfPositive ( ref LoadFullMaxBrakeForceN , FreightAnimations . FullPhysicsStaticOne ? . FullStaticMaxBrakeShoeForceN ) ;
738+ setIfPositive ( ref LoadFullMaxBrakeForceN , FreightAnimations . FullPhysicsStaticOne ? . FullStaticMaxBrakeForceN ) ;
739+ setIfPositive ( ref LoadFullMaxHandbrakeForceN , FreightAnimations . FullPhysicsStaticOne ? . FullStaticMaxHandbrakeForceN ) ;
740+ setIfPositive ( ref LoadFullCentreOfGravityM_Y , FreightAnimations . FullPhysicsStaticOne ? . FullStaticCentreOfGravityM_Y ) ;
741+ setIfPositive ( ref LoadFullRelayValveRatio , FreightAnimations . FullPhysicsStaticOne ? . FullStaticRelayValveRatio ) ;
742+ setIfPositive ( ref LoadFullInshotPSI , FreightAnimations . FullPhysicsStaticOne ? . FullStaticInshotPSI ) ;
742743
743744 // Read (initialise) Continuous load ones if a continuous load
744745 // Test each value to make sure that it has been defined in the WAG file, if not default to Root WAG file value
745- setIfNonZero ( ref LoadFullMassKg , FreightAnimations . WagonEmptyWeight + FreightAnimations . FullPhysicsContinuousOne ? . FreightWeightWhenFull ) ;
746- setIfNonZero ( ref LoadFullORTSDavis_A , FreightAnimations . FullPhysicsContinuousOne ? . FullORTSDavis_A ) ;
747- setIfNonZero ( ref LoadFullORTSDavis_B , FreightAnimations . FullPhysicsContinuousOne ? . FullORTSDavis_B ) ;
748- setIfNonZero ( ref LoadFullORTSDavis_C , FreightAnimations . FullPhysicsContinuousOne ? . FullORTSDavis_C ) ;
749- setIfNonZero ( ref LoadFullDavisDragConstant , FreightAnimations . FullPhysicsContinuousOne ? . FullORTSDavisDragConstant ) ;
750- setIfNonZero ( ref LoadFullWagonFrontalAreaM2 , FreightAnimations . FullPhysicsContinuousOne ? . FullORTSWagonFrontalAreaM2 ) ;
751- setIfNonZero ( ref LoadFullMaxBrakeForceN , FreightAnimations . FullPhysicsContinuousOne ? . FullMaxBrakeShoeForceN ) ;
752- setIfNonZero ( ref LoadFullMaxBrakeForceN , FreightAnimations . FullPhysicsContinuousOne ? . FullMaxBrakeForceN ) ;
753- setIfNonZero ( ref LoadFullMaxHandbrakeForceN , FreightAnimations . FullPhysicsContinuousOne ? . FullMaxHandbrakeForceN ) ;
754- setIfNonZero ( ref LoadFullCentreOfGravityM_Y , FreightAnimations . FullPhysicsContinuousOne ? . FullCentreOfGravityM_Y ) ;
755- setIfNonZero ( ref LoadFullRelayValveRatio , FreightAnimations . FullPhysicsContinuousOne ? . FullRelayValveRatio ) ;
746+ setIfPositive ( ref LoadFullMassKg , FreightAnimations . WagonEmptyWeight + FreightAnimations . FullPhysicsContinuousOne ? . FreightWeightWhenFull ) ;
747+ setIfPositive ( ref LoadFullORTSDavis_A , FreightAnimations . FullPhysicsContinuousOne ? . FullORTSDavis_A ) ;
748+ setIfPositive ( ref LoadFullORTSDavis_B , FreightAnimations . FullPhysicsContinuousOne ? . FullORTSDavis_B ) ;
749+ setIfPositive ( ref LoadFullORTSDavis_C , FreightAnimations . FullPhysicsContinuousOne ? . FullORTSDavis_C ) ;
750+ setIfPositive ( ref LoadFullDavisDragConstant , FreightAnimations . FullPhysicsContinuousOne ? . FullORTSDavisDragConstant ) ;
751+ setIfPositive ( ref LoadFullWagonFrontalAreaM2 , FreightAnimations . FullPhysicsContinuousOne ? . FullORTSWagonFrontalAreaM2 ) ;
752+ setIfPositive ( ref LoadFullMaxBrakeForceN , FreightAnimations . FullPhysicsContinuousOne ? . FullMaxBrakeShoeForceN ) ;
753+ setIfPositive ( ref LoadFullMaxBrakeForceN , FreightAnimations . FullPhysicsContinuousOne ? . FullMaxBrakeForceN ) ;
754+ setIfPositive ( ref LoadFullMaxHandbrakeForceN , FreightAnimations . FullPhysicsContinuousOne ? . FullMaxHandbrakeForceN ) ;
755+ setIfPositive ( ref LoadFullCentreOfGravityM_Y , FreightAnimations . FullPhysicsContinuousOne ? . FullCentreOfGravityM_Y ) ;
756+ setIfPositive ( ref LoadFullRelayValveRatio , FreightAnimations . FullPhysicsContinuousOne ? . FullRelayValveRatio ) ;
756757 setIfNonZero ( ref LoadFullInshotPSI , FreightAnimations . FullPhysicsContinuousOne ? . FullInshotPSI ) ;
757758
758759 if ( ! FreightAnimations . MSTSFreightAnimEnabled ) FreightShapeFileName = null ;
0 commit comments