Browse Source

解决人卡来回往复跳动的bug

lixioayao 6 years ago
parent
commit
7bd3dd6c38
2 changed files with 9 additions and 5 deletions
  1. 6 1
      ant.cpp
  2. 3 4
      card_message_handle.cpp

+ 6 - 1
ant.cpp

@@ -27,7 +27,6 @@ const algo_config&site::config()const
 {
 	return g_config[index()];
 }
-
 void ant::set_path(const std::vector<line_v>&v_line,std::vector<line_v>::const_iterator itm)
 {
 	auto it=itm;
@@ -41,6 +40,12 @@ void ant::set_path(const std::vector<line_v>&v_line,std::vector<line_v>::const_i
 		m_path[1][i].swap_point();
 	}
 
+    for(int i=0;i<2;i++)
+    {
+       point _p=m_path[i][0].line::projection(*this);
+       m_path[i][0].set_point(0,_p);
+    }
+
 	for(const auto&p:m_path)
 	{
 		log_info("site-path: %s",p.to_str().c_str());

+ 3 - 4
card_message_handle.cpp

@@ -119,10 +119,9 @@ struct one_ct_message_handle
 
 		std::vector<point> rc=std::move(m_loc_tool.calc_location(v));
 		log_info("calc_location:%d size:%d",m_card->m_id,rc.size());
-#if 1
-        if(v[0].m_sit->m_id==367)
-            for(const auto &_p:rc)
-		        log_info("calc_location:%d (%.2f,%.2f)",m_card->m_id,_p.x,_p.y);
+#if 0
+        for(const auto &_p:rc)
+		    log_info("calc_location:%d (%.2f,%.2f)",m_card->m_id,_p.x,_p.y);
 #endif
 
 		if(!rc.empty()) m_card->on_location(std::move(rc),v);