From 3eaf8b1b61d975e2e79ed3c441f13436feb88fe1 Mon Sep 17 00:00:00 2001 From: park671 Date: Mon, 5 Jun 2023 21:11:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0:=E6=94=AF=E6=8C=81=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E8=BE=B9=E7=95=8C=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/cpp/logic/render_map.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/src/main/cpp/logic/render_map.cpp b/app/src/main/cpp/logic/render_map.cpp index 115edc5..5aa0b11 100644 --- a/app/src/main/cpp/logic/render_map.cpp +++ b/app/src/main/cpp/logic/render_map.cpp @@ -245,12 +245,14 @@ bool MapRender::processKey(byte directKey, byte functionKey) { } bool MapRender::checkOutOfMap(Character *player, int targetX, int targetY) { - int map_height = map_size[mapId * 2]; - int map_width = map_size[mapId * 2 + 1]; - if (targetX < 0 - || targetY < 0 - || targetX > map_width - || targetY > map_height) { + byte startX = movable_offset[mapId*2]; + byte startY = movable_offset[mapId*2+1]; + byte endX = startX+movable_size[mapId*2]; + byte endY = startY+movable_size[mapId*2+1]; + if (targetX < startX + || targetY < startY + || targetX > endX + || targetY > endY) { entranceAnimation = ANIMATION_DURATION; pthread_mutex_lock(&changeMapMutex); --lastPosStackTop;