From 9c8ec08e2239e65c2c1cb81c572e423f48376b94 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 17 Jul 2023 14:46:23 +0800 Subject: [PATCH] update --- modules/caravan/api_gotocity.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 } }