From 8457c338fa19b7bcb7857f2625b3647e79df7c53 Mon Sep 17 00:00:00 2001 From: songhao Date: Thu, 6 Sep 2018 15:01:16 +0800 Subject: [PATCH] =?UTF-8?q?tiled=20bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cpp/tiledmap.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cpp/tiledmap.cc b/cpp/tiledmap.cc index a59cea4..acf9daf 100644 --- a/cpp/tiledmap.cc +++ b/cpp/tiledmap.cc @@ -278,6 +278,14 @@ bool TiledMap::CalcCurrPos(std::vector& path_points, int old_pos_x, int old if (path_points.size() < 2) { return false; } + + StagePoint* sp_terminal = GetStageObject(path_points[path_points.size()-1]); + if (sp_terminal && old_pos_x == sp_terminal->x && old_pos_y == sp_terminal->y) { + curr_pos_x = old_pos_x; + curr_pos_y = old_pos_y; + return true; + } + std::vector stage_path_list; { std::string path_point;