Track *start = track;
while(1)
{
- int out_ep = track->traverse(ep, trk_path);
- if(out_ep<0)
- break;
+ unsigned out_ep = track->traverse(ep, trk_path);
Track *next = track->get_links()[out_ep];
if(!next || next == start)
break;
offset += get_real_speed(loco.get_speed())*(dt/Time::sec);
if(offset>cur_track->get_type().get_path_length(path))
{
- int out = cur_track->traverse(cur_track_ep, path);
- if(out>=0)
- {
- Track *next = cur_track->get_link(out);
- if(next)
- cur_track_ep = next->get_endpoint_by_link(*cur_track);
- cur_track = next;
- offset = 0;
- }
- else
- cur_track = 0;
+ unsigned out = cur_track->traverse(cur_track_ep, path);
+ Track *next = cur_track->get_link(out);
+ if(next)
+ cur_track_ep = next->get_endpoint_by_link(*cur_track);
+ cur_track = next;
+ offset = 0;
}
if(cur_track)