Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
0267b62e53
15
src/bus.c
15
src/bus.c
|
@ -20,14 +20,25 @@ int GetBusPosition()
|
||||||
b = 0;
|
b = 0;
|
||||||
rail_node_t *p = rails;
|
rail_node_t *p = rails;
|
||||||
a = the_bus->rail_node_pos->id;//指向站点的指针以及这个指针对应的站台id
|
a = the_bus->rail_node_pos->id;//指向站点的指针以及这个指针对应的站台id
|
||||||
|
if (a == 1 && (the_bus->distance < 0))
|
||||||
|
{
|
||||||
|
while(p->id != p->last_node->id)
|
||||||
|
{
|
||||||
|
b += p->next_node_distance;
|
||||||
|
p = p->next_node;
|
||||||
|
}
|
||||||
|
b += p->next_node_distance;
|
||||||
|
c = b + (the_bus->distance);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
while (p->id != a){
|
while (p->id != a){
|
||||||
b += p->next_node_distance;
|
b += p->next_node_distance;
|
||||||
p = p->next_node;
|
p = p->next_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
c = b + (the_bus->distance);
|
c = b + (the_bus->distance);
|
||||||
|
}
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user