From b7f01dc163b6110dbb0527ce4dcd2d5caa89f647 Mon Sep 17 00:00:00 2001 From: Roger <61731332@qq.com> Date: Sat, 14 Mar 2020 09:52:04 +0800 Subject: [PATCH] fix a bug of GetSuroundGridByGid --- zinx_app_demo/mmo_game/core/aoi.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zinx_app_demo/mmo_game/core/aoi.go b/zinx_app_demo/mmo_game/core/aoi.go index c73de7b..6c85132 100644 --- a/zinx_app_demo/mmo_game/core/aoi.go +++ b/zinx_app_demo/mmo_game/core/aoi.go @@ -105,7 +105,7 @@ func (m *AOIManager) GetSurroundGridsByGid(gID int) (grids []*Grid) { newY := y + dy[i] if newX >= 0 && newX < m.CntsX && newY >= 0 && newY < m.CntsY { - surroundGid = append(surroundGid, newY*m.CntsX+x) + surroundGid = append(surroundGid, newY*m.CntsX+newX) } }