Browse Source
Merge pull request #60 from adsian/server_test
fix a bug of GetSuroundGridByGid
master
Gao Zhihui
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
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) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|