diff --git a/modules/caravan/comp_configure.go b/modules/caravan/comp_configure.go index 20f0050c3..60276daf2 100644 --- a/modules/caravan/comp_configure.go +++ b/modules/caravan/comp_configure.go @@ -24,10 +24,9 @@ const ( // /配置管理基础组件 type configureComp struct { modules.MCompConfigure - module *Caravan - lock sync.RWMutex - event map[int32][]*cfg.GameCaravanEventData - overflow int32 + module *Caravan + lock sync.RWMutex + event map[int32][]*cfg.GameCaravanEventData } // 组件初始化接口 @@ -50,16 +49,6 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp } this.lock.Unlock() }) - configure.RegisterConfigure(game_caravan_reward, cfg.NewGameCaravanReward, func() { - if v, err := this.GetConfigure(game_caravan_reward); err == nil { - for _, v := range v.(*cfg.GameCaravanReward).GetDataList() { - if v.Key < 0 { - this.overflow = v.Id - return - } - } - } - }) return } @@ -229,12 +218,14 @@ func (this *configureComp) GetCaravanMoreReward() (reward *cfg.GameCaravanReward ) if v, err = this.GetConfigure(game_caravan_reward); err == nil { if configure, ok := v.(*cfg.GameCaravanReward); ok { - if reward = configure.Get(this.overflow); err == nil { - return + for _, reward = range configure.GetDataList() { + if reward.Key < 0 { + return + } } } } - err = comm.NewNotFoundConfErr(moduleName, game_caravan_reward, this.overflow) + err = comm.NewNotFoundConfErr(moduleName, game_caravan_reward, "") return }