From b4fbb9d751c7df90245e238fc15e83e141a91030 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 8 Nov 2021 14:51:03 +0800 Subject: [PATCH] 1 --- server/gameserver/mapservice.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/gameserver/mapservice.cc b/server/gameserver/mapservice.cc index c38d1e1..4291aec 100644 --- a/server/gameserver/mapservice.cc +++ b/server/gameserver/mapservice.cc @@ -72,7 +72,7 @@ void MapService::UnInit() bool MapService::CanAdd(const a8::Vec2& pos, int rad) { //上 - if (pos.y + rad + 10 > map_height_) { + if (pos.y + rad + 10 > map_height_ * cell_width_) { return false; } //下 @@ -84,7 +84,7 @@ bool MapService::CanAdd(const a8::Vec2& pos, int rad) return false; } //右 - if (pos.x + rad + 10 > map_width_) { + if (pos.x + rad + 10 > map_width_ * cell_width_) { return false; } return true;