修复了顺便服务的请求应该在到站之前产生的bug

This commit is contained in:
jackfiled 2022-06-05 13:21:48 +08:00
parent 69909c72a1
commit 96961c91c9

View File

@ -142,12 +142,14 @@ bus_query_t *SSTFBTWQuery(int direction)
{ {
if(query->node == now_node) if(query->node == now_node)
{ {
int type = query->type; // 这里是设计上的缺陷在bus_time显示时间的前一秒公交车就实际上到达站台了
if(query->time < bus_time - 1)
if(type == direction || type == BUS_TARGET)
{ {
allow_query = query; if(query->type == direction || query->type == BUS_TARGET)
break; {
allow_query = query;
break;
}
} }
} }
query = query->next_node; query = query->next_node;
@ -280,7 +282,10 @@ bus_query_t *SCANBTWQuery()
{ {
if(p->node == now_position) if(p->node == now_position)
{ {
return p; if(p->time < bus_time - 1)
{
return p;
}
} }
p = p->next_node; p = p->next_node;
}//遍历请求链表,判断是否有可以顺便处理的请求 }//遍历请求链表,判断是否有可以顺便处理的请求