优化 抽卡获得顺序问题

This commit is contained in:
meixiongfeng 2023-06-13 12:27:42 +08:00
parent 0f8384554b
commit 34df1dbb35

View File

@ -321,16 +321,13 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
rsp := &pb.HeroDrawCardResp{
Data: []*pb.AtnoData{},
}
var addRes []*cfg.Gameatn
for _, heroId := range szCards {
addRes = append(addRes, &cfg.Gameatn{
if errdata, atno = this.module.DispenseAtno(session, []*cfg.Gameatn{{
A: "hero",
T: heroId,
N: 1,
})
}
if errdata, atno = this.module.DispenseAtno(session, addRes, true); errdata == nil {
}}, true); errdata == nil {
rsp.Data = append(rsp.Data, &pb.AtnoData{Atno: atno})
for _, v := range atno {
@ -343,6 +340,7 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
} else {
return
}
}
session.SendMsg(string(this.module.GetType()), DrawCard, rsp)
// 任务统计