update
This commit is contained in:
parent
b1134339bb
commit
9c8ec08e22
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user