mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-04 15:52:27 +08:00
修复场景小组配置id读取顺序问题
This commit is contained in:
@@ -59,6 +59,7 @@ type GameDataConfig struct {
|
||||
ReliquaryMainDataMap map[int32]map[int32]*ReliquaryMainData // 圣遗物主属性
|
||||
ReliquaryAffixDataMap map[int32]map[int32]*ReliquaryAffixData // 圣遗物追加属性
|
||||
QuestDataMap map[int32]*QuestData // 任务
|
||||
ParentQuestMap map[int32]map[int32]*QuestData // 父任务索引
|
||||
DropDataMap map[int32]*DropData // 掉落
|
||||
MonsterDropDataMap map[string]map[int32]*MonsterDropData // 怪物掉落
|
||||
ChestDropDataMap map[string]map[int32]*ChestDropData // 宝箱掉落
|
||||
|
||||
@@ -373,6 +373,15 @@ func (g *GameDataConfig) loadQuestData() {
|
||||
g.QuestDataMap[questData.QuestId] = questData
|
||||
}
|
||||
}
|
||||
g.ParentQuestMap = make(map[int32]map[int32]*QuestData)
|
||||
for _, questData := range g.QuestDataMap {
|
||||
questMap, exist := g.ParentQuestMap[questData.ParentQuestId]
|
||||
if !exist {
|
||||
questMap = make(map[int32]*QuestData)
|
||||
g.ParentQuestMap[questData.ParentQuestId] = questMap
|
||||
}
|
||||
questMap[questData.QuestId] = questData
|
||||
}
|
||||
logger.Info("QuestData count: %v", len(g.QuestDataMap))
|
||||
}
|
||||
|
||||
@@ -383,3 +392,7 @@ func GetQuestDataById(questId int32) *QuestData {
|
||||
func GetQuestDataMap() map[int32]*QuestData {
|
||||
return CONF.QuestDataMap
|
||||
}
|
||||
|
||||
func GetQuestDataMapByParentQuestId(parentQuestId int32) map[int32]*QuestData {
|
||||
return CONF.ParentQuestMap[parentQuestId]
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ type Group struct {
|
||||
RegionMap map[int32]*Region `json:"-"` // 区域
|
||||
TriggerMap map[string]*Trigger `json:"-"` // 触发器
|
||||
GroupInitConfig *GroupInitConfig `json:"-"` // 初始化配置
|
||||
SuiteList []*Suite `json:"-"` // 小组配置
|
||||
SuiteMap map[int32]*Suite `json:"-"` // 小组配置
|
||||
LuaStr string `json:"-"` // LUA原始字符串缓存
|
||||
LuaState *lua.LState `json:"-"` // LUA虚拟机实例
|
||||
}
|
||||
@@ -241,8 +241,8 @@ func (g *GameDataConfig) loadGroup(group *Group, block *Block, sceneId int32, bl
|
||||
if len(suiteLuaTableList) == 0 {
|
||||
// logger.Debug("get suites object is nil, sceneId: %v, blockId: %v, groupId: %v", sceneId, blockId, groupId)
|
||||
}
|
||||
group.SuiteList = make([]*Suite, 0)
|
||||
for _, suiteLuaTable := range suiteLuaTableList {
|
||||
group.SuiteMap = make(map[int32]*Suite)
|
||||
for index, suiteLuaTable := range suiteLuaTableList {
|
||||
suite := &Suite{
|
||||
MonsterConfigIdList: make([]int32, 0),
|
||||
GadgetConfigIdList: make([]int32, 0),
|
||||
@@ -274,7 +274,7 @@ func (g *GameDataConfig) loadGroup(group *Group, block *Block, sceneId int32, bl
|
||||
suite.TriggerNameList = append(suite.TriggerNameList, nameAny.(string))
|
||||
}
|
||||
}
|
||||
group.SuiteList = append(group.SuiteList, suite)
|
||||
group.SuiteMap[int32(len(suiteLuaTableList)-index)] = suite
|
||||
}
|
||||
luaState.Close()
|
||||
block.groupMapLoadLock.Lock()
|
||||
|
||||
Reference in New Issue
Block a user