From 7a7c076dec4036a07269fd4d891cff3adf54cd40 Mon Sep 17 00:00:00 2001 From: liwei <2211068034@qq.com> Date: Wed, 28 Jun 2023 11:53:32 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=9A=8F=E6=9C=BA?= =?UTF-8?q?=E5=AE=9D=E7=AE=B1=E6=89=B9=E9=87=8F=E4=BD=BF=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/items/modelitems.go | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/modules/items/modelitems.go b/modules/items/modelitems.go index 5feaa774e..f9680c669 100644 --- a/modules/items/modelitems.go +++ b/modules/items/modelitems.go @@ -754,21 +754,27 @@ func (this *ModelItemsComp) useitem(session comm.IUserSession, gid string, amoun } case itemuse_randombox: //宝箱 user := this.module.ModuleUser.GetUser(session.GetUserId()) - 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 { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_ConfigNoFound, - Title: pb.ErrorCode_ConfigNoFound.ToString(), - Message: fmt.Sprintf("掉落组未找到:%d", itemcf.BoxId), + 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.configure.GetDropData(itemcf.BoxId); prop == nil { + errdata = &pb.ErrorData{ + Code: pb.ErrorCode_ConfigNoFound, + Title: pb.ErrorCode_ConfigNoFound.ToString(), + Message: fmt.Sprintf("掉落组未找到:%d", itemcf.BoxId), + } + return + } else { + props = append(props, prop...) } + + } + + if errdata = this.module.AddItemforGrid(session, gid, -1*int32(amount), true); errdata != nil { + return + } + if errdata = this.module.DispenseRes(session, props, true); errdata != nil { return - } else { - if errdata = this.module.AddItemforGrid(session, gid, -1*int32(amount), true); errdata != nil { - return - } - if errdata = this.module.DispenseRes(session, prop, true); errdata != nil { - return - } } case itemuse_staminapotion: //体力药剂使用 From 803700c43ca44379c403e53423cf75aebb85911f Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Wed, 28 Jun 2023 13:58:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/json/game_opencond.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/json/game_opencond.json b/bin/json/game_opencond.json index 5ebcbced2..6965b18e0 100644 --- a/bin/json/game_opencond.json +++ b/bin/json/game_opencond.json @@ -606,7 +606,7 @@ "main": [ { "key": 1, - "param": 1 + "param": 9999 } ], "wkqbx": 2, @@ -1532,7 +1532,7 @@ "main": [ { "key": 1, - "param": 10 + "param": 6 } ], "wkqbx": 0, @@ -1557,7 +1557,7 @@ "main": [ { "key": 1, - "param": 20 + "param": 10 } ], "wkqbx": 0,