From 17336c7996365ac1e3330c4ea9a71574cc2a8a16 Mon Sep 17 00:00:00 2001 From: aceld Date: Fri, 31 May 2019 21:02:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3aoi=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=9D=90=E6=A0=87=E8=8E=B7=E5=8F=96=E6=A0=BC=E5=AD=90ID=20x,y?= =?UTF-8?q?=E5=86=99=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 38f99cd..87e5d64 100644 --- a/zinx_app_demo/mmo_game/core/aoi.go +++ b/zinx_app_demo/mmo_game/core/aoi.go @@ -129,7 +129,7 @@ func (m *AOIManager) GetSurroundGridsByGid(gID int) (grids []*Grid) { //通过横纵坐标获取对应的格子ID func (m *AOIManager) GetGidByPos(x, y float32) int { gx := (int(x) - m.MinX) / m.gridWidth() - gy := (int(x) - m.MinY) / m.gridLength() + gy := (int(y) - m.MinY) / m.gridLength() return gy*m.CntsX + gx }