diff --git a/logic/service/space/space.go b/logic/service/space/space.go index f0546834..00989ed0 100644 --- a/logic/service/space/space.go +++ b/logic/service/space/space.go @@ -146,36 +146,6 @@ func (ret *Space) init() { maphot[ret.Super].TipInfoS = make(map[uint32]*TipInfo, 0) } - tips := &TipInfo{} - r := service.NewMapService().GetData(ret.ID) - if r != nil { - tips.Diao = service.NewMapService().GetData(ret.ID).DropItemIds - } - - pits := service.NewMapPitService().GetDataALL(ret.ID) - ret.PitS = csmap.New[int, []model.MapPit]() - - for _, v := range pits { - - tips.Pet = append(tips.Pet, v.RefreshID...) - for _, vp := range v.Pos { - t, ok := ret.PitS.Load(vp) - if ok { - t = append(t, v) - ret.PitS.Store(vp, t) - } else { - ret.PitS.Store(vp, []model.MapPit{v}) - } - - } - - } - - tips.Pet = lo.Union(tips.Pet) - tips.Talk = service.NewTalkConfigService().GetTip(ret.ID) - tips.Boss = service.NewMapNodeService().GetTip(ret.ID) - maphot[ret.Super].TipInfoS[ret.ID] = tips - ret.Name = v.Name //ogreconfig := service.NewMapPitService().GetData(ret.ID, uint32(i)) @@ -183,6 +153,38 @@ func (ret *Space) init() { } } + tips := &TipInfo{} + r := service.NewMapService().GetData(ret.ID) + if r != nil { + tips.Diao = service.NewMapService().GetData(ret.ID).DropItemIds + } + + pits := service.NewMapPitService().GetDataALL(ret.ID) + ret.PitS = csmap.New[int, []model.MapPit]() + + for _, v := range pits { + + tips.Pet = append(tips.Pet, v.RefreshID...) + for _, vp := range v.Pos { + t, ok := ret.PitS.Load(vp) + if ok { + t = append(t, v) + ret.PitS.Store(vp, t) + } else { + ret.PitS.Store(vp, []model.MapPit{v}) + } + + } + + } + + if ret.Super != 0 { + tips.Pet = lo.Union(tips.Pet) + tips.Talk = service.NewTalkConfigService().GetTip(ret.ID) + tips.Boss = service.NewMapNodeService().GetTip(ret.ID) + maphot[ret.Super].TipInfoS[ret.ID] = tips + } + } r := service.NewMapService().GetData(ret.ID)