zhuyf 2 years ago
parent
commit
3dda810fcd
1 changed files with 6 additions and 0 deletions
  1. 6 0
      card_car.cpp

+ 6 - 0
card_car.cpp

@@ -79,6 +79,12 @@ void car::handle_anti_coll(const point& pt, const int& sid)
 				continue;
 			}
 
+			// 避免历史定位数据的影响
+			uint64_t now = time(0)*1000;
+			if(c.second.m_time - now > 60){
+				continue;
+			}
+
             bool s = false;
             int d = (c.second->m_timeval >= m_timeval ? (c.second->m_timeval - m_timeval) : (m_timeval - c.second->m_timeval)) / 1000.0;
             s = ((c.second->m_timeval >= m_timeval ? (c.second->m_timeval - m_timeval) : (m_timeval - c.second->m_timeval)) /1000.0 <= 30);