diff --git a/modules/caravan/api_gotocity.go b/modules/caravan/api_gotocity.go index f66ee0ddd..1833ddd30 100644 --- a/modules/caravan/api_gotocity.go +++ b/modules/caravan/api_gotocity.go @@ -77,18 +77,18 @@ func (this *apiComp) GotoCity(session comm.IUserSession, req *pb.CaravanGotoCity if bNewTask { // 到该城市随机一个新的任务 if newCity, e := this.module.configure.GetCaravanCity(req.City); e == nil { if elist, err := this.module.configure.GetCaravanEventByGroup(newCity.Cityevent); err == nil { - var sz []int32 + var sz []*cfg.GameCaravanEventData for _, v := range elist { if _, ok := list.Group[v.Worldtask]; !ok { - sz = append(sz, v.Worldtask) + sz = append(sz, v) } } if len(sz) > 0 { // 容错处理 var randW []int32 for _, v := range sz { - randW = append(randW, v) + randW = append(randW, v.Eventweight) } - list.Eventid = sz[comm.GetRandW(randW)] + list.Eventid = sz[comm.GetRandW(randW)].Id } }