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) } }