GetBusPosition函数代码风格修改

This commit is contained in:
nvhaizi1 2022-05-24 22:52:38 +08:00
parent 0f4d0c511c
commit 0685b45ce8

View File

@ -15,17 +15,16 @@ void RunBus(int direction)
} }
int GetBusPosition() int GetBusPosition()
{ {
int a,b,c; int a, b, c;
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
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;
} }
int JudgeOnStation() int JudgeOnStation()
{ {