修复AOI的BUG问题

This commit is contained in:
flswld
2023-04-14 13:34:47 +08:00
parent e7c5723f98
commit ae5f2809bf
9 changed files with 74 additions and 83 deletions
+2 -3
View File
@@ -438,9 +438,8 @@ func (g *Game) AddSceneEntityNotify(player *model.Player, visionType proto.Visio
}
entityList := make([]*proto.SceneEntityInfo, 0)
for _, entityId := range entityIdList[begin:end] {
entityMap := scene.GetAllEntity()
entity, exist := entityMap[entityId]
if !exist {
entity := scene.GetEntity(entityId)
if entity == nil {
logger.Error("get entity is nil, entityId: %v", entityId)
continue
}