I believe I have found a second small bug in the ORTS sigscr.dat parser.
ORTS does not like this script:
SCRIPT AVV2610
extern float route_set ();
extern float this_sig_lr ();
extern float draw_state;
extern float block_state ();
extern float sig_feature ();
float this_dis;
this_dis = this_sig_lr (SIGFN_DISTANCE);
if ( !route_set () )
draw_state = 4;
else if ( this_dis ==# 6 )
if ( !sig_feature (SIGFEAT_USER2) )
draw_state = 0; // Giallo Verde Lampeggiante Alternato
else draw_state = 2; // Giallo Verde Lampeggiante Alternato/M
// Fine Giallo Verde Lampeggiante Alternato
else if ( this_dis ==# 4 )
if ( !sig_feature (SIGFEAT_USER2) )
draw_state = 1; // Giallo Verde Lampeggiante
else draw_state = 3; // Giallo Verde Lampeggiante/M
// Fine Giallo Verde Lampeggiante
else draw_state = 4; // Nothing
Following errors are reported by the log file:
Warning: Unexpected number of = in string : ELSE IF ( THIS_DIS = 4 )IF ( !SIG_FEATURE (SIGFEAT_USER2) )DRAW_STATE = 1
Warning: Unmatching brackets in : ELSE IF ( THIS_DIS
If you however add a pair of braces after the else if block ABOVE the one giving the error, as shown herebelow, the error disappears.
////////////////////////////
SCRIPT AVV2610
extern float route_set ();
extern float this_sig_lr ();
extern float draw_state;
extern float block_state ();
extern float sig_feature ();
float this_dis;
this_dis = this_sig_lr (SIGFN_DISTANCE);
if ( !route_set () )
draw_state = 4;
else if ( this_dis ==# 6 )
{
if ( !sig_feature (SIGFEAT_USER2) )
draw_state = 0; // Giallo Verde Lampeggiante Alternato
else draw_state = 2; // Giallo Verde Lampeggiante Alternato/M
}
// Fine Giallo Verde Lampeggiante Alternato
else if ( this_dis ==# 4 )
if ( !sig_feature (SIGFEAT_USER2) )
draw_state = 1; // Giallo Verde Lampeggiante
else draw_state = 3; // Giallo Verde Lampeggiante/M
// Fine Giallo Verde Lampeggiante
else draw_state = 4; // Nothing
ORTS does not like this script:
SCRIPT AVV2610
extern float route_set ();
extern float this_sig_lr ();
extern float draw_state;
extern float block_state ();
extern float sig_feature ();
float this_dis;
this_dis = this_sig_lr (SIGFN_DISTANCE);
if ( !route_set () )
draw_state = 4;
else if ( this_dis ==# 6 )
if ( !sig_feature (SIGFEAT_USER2) )
draw_state = 0; // Giallo Verde Lampeggiante Alternato
else draw_state = 2; // Giallo Verde Lampeggiante Alternato/M
// Fine Giallo Verde Lampeggiante Alternato
else if ( this_dis ==# 4 )
if ( !sig_feature (SIGFEAT_USER2) )
draw_state = 1; // Giallo Verde Lampeggiante
else draw_state = 3; // Giallo Verde Lampeggiante/M
// Fine Giallo Verde Lampeggiante
else draw_state = 4; // Nothing
Following errors are reported by the log file:
Warning: Unexpected number of = in string : ELSE IF ( THIS_DIS = 4 )IF ( !SIG_FEATURE (SIGFEAT_USER2) )DRAW_STATE = 1
Warning: Unmatching brackets in : ELSE IF ( THIS_DIS
If you however add a pair of braces after the else if block ABOVE the one giving the error, as shown herebelow, the error disappears.
////////////////////////////
SCRIPT AVV2610
extern float route_set ();
extern float this_sig_lr ();
extern float draw_state;
extern float block_state ();
extern float sig_feature ();
float this_dis;
this_dis = this_sig_lr (SIGFN_DISTANCE);
if ( !route_set () )
draw_state = 4;
else if ( this_dis ==# 6 )
{
if ( !sig_feature (SIGFEAT_USER2) )
draw_state = 0; // Giallo Verde Lampeggiante Alternato
else draw_state = 2; // Giallo Verde Lampeggiante Alternato/M
}
// Fine Giallo Verde Lampeggiante Alternato
else if ( this_dis ==# 4 )
if ( !sig_feature (SIGFEAT_USER2) )
draw_state = 1; // Giallo Verde Lampeggiante
else draw_state = 3; // Giallo Verde Lampeggiante/M
// Fine Giallo Verde Lampeggiante
else draw_state = 4; // Nothing





Comment