Index: vehicle/simroadtraffic.cc =================================================================== --- vehicle/simroadtraffic.cc (Revision 9259) +++ vehicle/simroadtraffic.cc (Arbeitskopie) @@ -649,16 +649,25 @@ // traffic light phase check (since this is on next tile, it will always be necessary!) const ribi_t::ribi direction90 = ribi_type(get_pos(), pos_next); - if( weg->has_sign( )) { + if( weg->has_sign() ) { const roadsign_t* rs = from->find(); const roadsign_desc_t* rs_desc = rs->get_desc(); - if(rs_desc->is_traffic_light() && (rs->get_dir()&direction90)==0) { - direction = direction90; - calc_image(); - // wait here - current_speed = 48; - weg_next = 0; - return NULL; + if( rs_desc->is_traffic_light() && (rs->get_dir()&direction90)==0 ) { + // red traffic light, but we go on, if we are already on a traffic light + bool go_on = false; + if( const grund_t *gr_current = welt->lookup(get_pos()) ) { + if( const roadsign_t *rs = gr_current->find() ) { + go_on = rs && rs->get_desc()->is_traffic_light() && !from->ist_uebergang(); + } + } + if( !go_on ) { + direction = direction90; + calc_image(); + // wait here + current_speed = 48; + weg_next = 0; + return NULL; + } } } Index: vehicle/simvehicle.cc =================================================================== --- vehicle/simvehicle.cc (Revision 9259) +++ vehicle/simvehicle.cc (Arbeitskopie) @@ -2067,10 +2067,19 @@ if( leading ) { // no further check, when already entered a crossing (to allow leaving it) if( !second_check_count ) { - const grund_t *gr_current = welt->lookup(get_pos()); - if( gr_current && gr_current->ist_uebergang() ) { - return true; + if( const grund_t *gr_current = welt->lookup(get_pos()) ) { + if( gr_current && gr_current->ist_uebergang() ) { + return true; + } } + // always allow to leave traffic lights (avoid vehicles stuck on crossings directly after though) + if( const grund_t *gr_current = welt->lookup(get_pos()) ) { + if( const roadsign_t *rs = gr_current->find() ) { + if( rs && rs->get_desc()->is_traffic_light() && !gr->ist_uebergang() ) { + return true; + } + } + } } assert(gr); @@ -2185,6 +2194,7 @@ if( str->has_sign() ) { rs = gr->find(); if( rs ) { +#if 0 // since at the corner, our direction may be diagonal, we make it straight if( rs->get_desc()->is_traffic_light() && (rs->get_dir() & curr_90direction)==0 ) { // wait here @@ -2191,9 +2201,10 @@ restart_speed = 16; return false; } + else +#endif // check, if we reached a choose point - - else if( rs->is_free_route(curr_90direction) && !target_halt.is_bound() ) { + if( rs->is_free_route(curr_90direction) && !target_halt.is_bound() ) { if( second_check_count ) { return false; }