上传随机宝箱批量使用代码
This commit is contained in:
parent
926b45ffde
commit
7a7c076dec
@ -754,6 +754,8 @@ func (this *ModelItemsComp) useitem(session comm.IUserSession, gid string, amoun
|
|||||||
}
|
}
|
||||||
case itemuse_randombox: //宝箱
|
case itemuse_randombox: //宝箱
|
||||||
user := this.module.ModuleUser.GetUser(session.GetUserId())
|
user := this.module.ModuleUser.GetUser(session.GetUserId())
|
||||||
|
props := make([]*cfg.Gameatn, 0)
|
||||||
|
for i := int32(0); i < amount; i++ {
|
||||||
if prop := this.module.ModuleTools.GetGroupDataByLottery(itemcf.BoxId, user.Vip, user.Lv); len(prop) == 0 {
|
if prop := this.module.ModuleTools.GetGroupDataByLottery(itemcf.BoxId, user.Vip, user.Lv); len(prop) == 0 {
|
||||||
//if prop = this.module.configure.GetDropData(itemcf.BoxId); prop == nil {
|
//if prop = this.module.configure.GetDropData(itemcf.BoxId); prop == nil {
|
||||||
errdata = &pb.ErrorData{
|
errdata = &pb.ErrorData{
|
||||||
@ -763,13 +765,17 @@ func (this *ModelItemsComp) useitem(session comm.IUserSession, gid string, amoun
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
props = append(props, prop...)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if errdata = this.module.AddItemforGrid(session, gid, -1*int32(amount), true); errdata != nil {
|
if errdata = this.module.AddItemforGrid(session, gid, -1*int32(amount), true); errdata != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if errdata = this.module.DispenseRes(session, prop, true); errdata != nil {
|
if errdata = this.module.DispenseRes(session, props, true); errdata != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
case itemuse_staminapotion: //体力药剂使用
|
case itemuse_staminapotion: //体力药剂使用
|
||||||
if itemcf.DecomposeGet == nil || len(itemcf.DecomposeGet) == 0 {
|
if itemcf.DecomposeGet == nil || len(itemcf.DecomposeGet) == 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user