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