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

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

View File

@ -142,14 +142,16 @@ 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) {
if(query->type == direction || query->type == BUS_TARGET)
{ {
allow_query = query; allow_query = query;
break; break;
} }
} }
}
query = query->next_node; query = query->next_node;
} }
@ -279,9 +281,12 @@ bus_query_t *SCANBTWQuery()
while(p != NULL) while(p != NULL)
{ {
if(p->node == now_position) if(p->node == now_position)
{
if(p->time < bus_time - 1)
{ {
return p; return p;
} }
}
p = p->next_node; p = p->next_node;
}//遍历请求链表,判断是否有可以顺便处理的请求 }//遍历请求链表,判断是否有可以顺便处理的请求