场景区块异步加载bug修复
This commit is contained in:
1 parent
f390bc1686
commit
6af98227c7
1 file changed
+2
-2
@@ -541,10 +541,9 @@ func (g *Game) LoadSceneBlockAsync(player *model.Player, oldScene *Scene, newSce
|
||||
// 跨越了block格子
|
||||
logger.Debug("player cross scene block grid, oldGid: %v, newGid: %v, uid: %v", oldGid, newGid, player.PlayerId)
|
||||
if player.SceneBlockAsyncLoad {
|
||||
return true
|
||||
return false
|
||||
}
|
||||
logger.Info("async load player scene block from db, uid: %v", player.PlayerId)
|
||||
player.SceneBlockAsyncLoad = true
|
||||
oldGridList := oldSceneBlockAoi.GetSurrGridListByGid(oldGid, 1)
|
||||
newGridList := newSceneBlockAoi.GetSurrGridListByGid(newGid, 1)
|
||||
delGridIdList := make([]uint32, 0)
|
||||
@@ -589,6 +588,7 @@ func (g *Game) LoadSceneBlockAsync(player *model.Player, oldScene *Scene, newSce
|
||||
if len(loadSceneBlockMap) == 0 {
|
||||
return false
|
||||
}
|
||||
player.SceneBlockAsyncLoad = true
|
||||
go func() {
|
||||
loadSceneBlockList := make([]*model.SceneBlock, 0)
|
||||
for _, block := range loadSceneBlockMap {
|
||||
|
||||
Reference in new issue
Block a user