Browse Source

Merge pull request #60 from adsian/server_test

fix a bug of GetSuroundGridByGid
master
Gao Zhihui 5 years ago
committed by GitHub
parent
commit
08079d1e13
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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