Browse Source

fix a bug of GetSuroundGridByGid

master
Roger 5 years ago
parent
commit
b7f01dc163
  1. 2
      zinx_app_demo/mmo_game/core/aoi.go

2
zinx_app_demo/mmo_game/core/aoi.go

@ -105,7 +105,7 @@ func (m *AOIManager) GetSurroundGridsByGid(gID int) (grids []*Grid) {
newY := y + dy[i] newY := y + dy[i]
if newX >= 0 && newX < m.CntsX && newY >= 0 && newY < m.CntsY { 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)
} }
} }

Loading…
Cancel
Save