From 9240c61c92f8f8c07ea0eb266bc67df79678a5d2 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 17 Aug 2020 15:32:37 +0800 Subject: [PATCH] 1 --- server/gameserver/navmeshbuilder.cc | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/server/gameserver/navmeshbuilder.cc b/server/gameserver/navmeshbuilder.cc index 28547fc..9b4f5a3 100644 --- a/server/gameserver/navmeshbuilder.cc +++ b/server/gameserver/navmeshbuilder.cc @@ -388,6 +388,17 @@ void NavMeshBuilder::BuildMapObstalce(BuilderParams& builder_params) if (status != DT_SUCCESS) { abort(); } + { + bool uptodate = false; + int update_count = 0; + while (!uptodate) { + tile_cache->update(0, builder_params.navmesh, &uptodate); + ++update_count; + if (update_count > 10000 * 10) { + abort(); + } + } + } } break; case CT_Circle: @@ -408,6 +419,17 @@ void NavMeshBuilder::BuildMapObstalce(BuilderParams& builder_params) if (status != DT_SUCCESS) { abort(); } + { + bool uptodate = false; + int update_count = 0; + while (!uptodate) { + tile_cache->update(0, builder_params.navmesh, &uptodate); + ++update_count; + if (update_count > 10000 * 10) { + abort(); + } + } + } } break; default: @@ -416,5 +438,5 @@ void NavMeshBuilder::BuildMapObstalce(BuilderParams& builder_params) break; } } - } + }//end for pair }