浏览代码

地图修改比例尺错误

chensongchao 5 年之前
父节点
当前提交
c387b022dd
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 9 3
      module_service/module_meta_date_changed.cpp

+ 9 - 3
module_service/module_meta_date_changed.cpp

@@ -450,10 +450,16 @@ void module_meta_date_changed::update_map_info(int id)
         log_error("修改地图失败,数据库中找不到: map_id=%d", id);
         return ;
     }
-
     double scale  = 0;
-    DBRes.GetField( "scale",scale, Error );
-
+    if (DBRes.GetNextRecod(Error))
+    {
+        DBRes.GetField("scale", scale, Error);
+    }
+    if (scale < 1e-4)
+    {
+        log_error("修改地图,数据库地图比例尺错误: map_id=%d,scale=%.2f", id,scale);
+        return;
+    }
     auto area = area_list::instance()->m_map;
     for(auto& it : area)
     {