场景group加载卸载流程优化

This commit is contained in:
flswld
2023-03-22 19:35:55 +08:00
parent b5267d57d8
commit e370098d86
7 changed files with 200 additions and 105 deletions
+7 -1
View File
@@ -397,7 +397,12 @@ func (s *Scene) AddGroupSuite(groupId uint32, suiteId uint8) {
logger.Error("get scene group config is nil, groupId: %v", groupId)
return
}
suiteConfig := groupConfig.SuiteList[suiteId-1]
suiteIndex := suiteId - 1
if int(suiteIndex) >= len(groupConfig.SuiteList) {
logger.Error("invalid suiteId: %v", suiteId)
return
}
suiteConfig := groupConfig.SuiteList[suiteIndex]
suite := &Suite{
entityMap: make(map[uint32]*Entity),
}
@@ -431,6 +436,7 @@ func (s *Scene) AddGroupSuite(groupId uint32, suiteId uint8) {
group = &Group{
suiteMap: make(map[uint8]*Suite),
}
s.groupMap[groupId] = group
}
group.suiteMap[suiteId] = suite
}