@@ -884,6 +884,8 @@ public override void NotifyEvent(ActivityEventType EventType)
884
884
double sinceActArriveS = ( new DateTime ( ) . Add ( TimeSpan . FromSeconds ( Simulator . ClockTime ) )
885
885
- ActArrive ) . Value . TotalSeconds ;
886
886
BoardingEndS -= sinceActArriveS ;
887
+
888
+ ldbfevaldepartbeforeboarding = false ; // reset flag. Debrief Eval
887
889
}
888
890
else
889
891
{
@@ -900,29 +902,30 @@ public override void NotifyEvent(ActivityEventType EventType)
900
902
if ( BoardingS > 0 || ( ( double ) ( SchDepart - SchArrive ) . TotalSeconds > 0 &&
901
903
MyPlayerTrain . PassengerCarsNumber == 1 && MyPlayerTrain . Cars . Count > 10 ) )
902
904
{
903
- // accepted station stop because either freight train or passenger train or fake passenger train with passenger car on platform or fake passenger train
905
+ // accepted station stop because either freight train or passenger train or fake passenger train with passenger car on platform or fake passenger train
904
906
// with Scheduled Depart > Scheduled Arrive
905
- // ActArrive is usually same as ClockTime
906
- BoardingEndS = Simulator . ClockTime + BoardingS ;
907
+ // ActArrive is usually same as ClockTime
908
+ BoardingEndS = Simulator . ClockTime + BoardingS ;
907
909
908
- if ( ActArrive == null )
909
- {
910
- ActArrive = new DateTime ( ) . Add ( TimeSpan . FromSeconds ( Simulator . ClockTime ) ) ;
911
- }
910
+ if ( ActArrive == null )
911
+ {
912
+ ActArrive = new DateTime ( ) . Add ( TimeSpan . FromSeconds ( Simulator . ClockTime ) ) ;
913
+ }
912
914
913
- arrived = true ;
914
- // But not if game starts after scheduled arrival. In which case actual arrival is assumed to be same as schedule arrival.
915
- double sinceActArriveS = ( new DateTime ( ) . Add ( TimeSpan . FromSeconds ( Simulator . ClockTime ) )
916
- - ActArrive ) . Value . TotalSeconds ;
917
- BoardingEndS -= sinceActArriveS ;
918
- double SchDepartS = SchDepart . Subtract ( new DateTime ( ) ) . TotalSeconds ;
919
- BoardingEndS = CompareTimes . LatestTime ( ( int ) SchDepartS , ( int ) BoardingEndS ) ;
915
+ arrived = true ;
916
+ // But not if game starts after scheduled arrival. In which case actual arrival is assumed to be same as schedule arrival.
917
+ double sinceActArriveS = ( new DateTime ( ) . Add ( TimeSpan . FromSeconds ( Simulator . ClockTime ) )
918
+ - ActArrive ) . Value . TotalSeconds ;
919
+ BoardingEndS -= sinceActArriveS ;
920
+ double SchDepartS = SchDepart . Subtract ( new DateTime ( ) ) . TotalSeconds ;
921
+ BoardingEndS = CompareTimes . LatestTime ( ( int ) SchDepartS , ( int ) BoardingEndS ) ;
920
922
921
- }
922
923
}
924
+
925
+ ldbfevaldepartbeforeboarding = false ; // reset flag. Debrief Eval
926
+ }
923
927
if ( MyPlayerTrain . NextSignalObject [ 0 ] != null )
924
928
distanceToNextSignal = MyPlayerTrain . NextSignalObject [ 0 ] . DistanceTo ( MyPlayerTrain . FrontTDBTraveller ) ;
925
-
926
929
}
927
930
}
928
931
else if ( EventType == ActivityEventType . TrainStart )
@@ -937,6 +940,15 @@ public override void NotifyEvent(ActivityEventType EventType)
937
940
if ( MyPlayerTrain . TrainType != Train . TRAINTYPE . AI_PLAYERHOSTING )
938
941
MyPlayerTrain . ClearStation ( PlatformEnd1 . LinkedPlatformItemId , PlatformEnd2 . LinkedPlatformItemId , true ) ;
939
942
943
+ // Debrief Eval: departure before boarding completed
944
+ if ( ! maydepart && ! ldbfevaldepartbeforeboarding )
945
+ {
946
+ var train = Simulator . PlayerLocomotive . Train ;
947
+ ldbfevaldepartbeforeboarding = true ;
948
+ DbfEvalDepartBeforeBoarding . Add ( PlatformEnd1 . Station ) ;
949
+ train . DbfEvalValueChanged = true ;
950
+ }
951
+
940
952
if ( LogStationStops )
941
953
{
942
954
StringBuilder stringBuild = new StringBuilder ( ) ;
@@ -981,15 +993,6 @@ public override void NotifyEvent(ActivityEventType EventType)
981
993
{
982
994
DisplayMessage = Simulator . Catalog . GetStringFmt ( "Passenger boarding completes in {0:D2}:{1:D2}" ,
983
995
remaining / 60 , remaining % 60 ) ;
984
-
985
- //Debrief Eval
986
- if ( Simulator . PlayerLocomotive . SpeedMpS > 0 && ! ldbfevaldepartbeforeboarding )
987
- {
988
- var train = Simulator . PlayerLocomotive . Train ;
989
- ldbfevaldepartbeforeboarding = true ;
990
- DbfEvalDepartBeforeBoarding . Add ( PlatformEnd1 . Station ) ;
991
- train . DbfEvalValueChanged = true ;
992
- }
993
996
}
994
997
// May depart
995
998
else if ( ! maydepart )
@@ -1008,8 +1011,6 @@ public override void NotifyEvent(ActivityEventType EventType)
1008
1011
if ( MyPlayerTrain . IsActualPlayerTrain ) Simulator . SoundNotify = Event . PermissionToDepart ;
1009
1012
}
1010
1013
1011
- ldbfevaldepartbeforeboarding = false ; //reset flag. Debrief Eval
1012
-
1013
1014
// if last task, show closure window
1014
1015
// also set times in logfile
1015
1016
0 commit comments