From 3506ab4203b6b76a6a2cffe45e57b9372849cee2 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Thu, 8 Jun 2023 16:29:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=9F=8B=E7=82=B9=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/buried/module.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/modules/buried/module.go b/modules/buried/module.go index 59222869e..dccbc37d5 100644 --- a/modules/buried/module.go +++ b/modules/buried/module.go @@ -133,6 +133,8 @@ func (this *Buried) CheckCondition(uid string, condiIds ...int32) (condis []*pb. var ( bdatas *pb.DBBuried conf *cfg.GameBuriedCondiData + bdata *pb.DBBuriedItem + ok bool ) if bdatas, err = this.modelBuried.getUserBurieds(uid); err != nil { return @@ -142,7 +144,7 @@ func (this *Buried) CheckCondition(uid string, condiIds ...int32) (condis []*pb. if conf, err = this.configure.getburiedcondidata(v); err != nil { return } - if bdata, ok := bdatas.Items[conf.Type]; ok { + if bdata, ok = bdatas.Items[conf.Type]; ok { ok = false for _, v1 := range bdata.Condi { if v1.Conid == v { @@ -172,16 +174,8 @@ func (this *Buried) CheckCondition(uid string, condiIds ...int32) (condis []*pb. }) } } - if !ok { //未找到 初始化一个 - condis = append(condis, &pb.ConIProgress{ - Btype: conf.Type, - Conid: v, - Value: 0, - Target: conf.Value, - State: pb.BuriedItemFinishState_buried_unfinish, - }) - } - } else { //未找到 初始化一个 + } + if !ok { //未找到 初始化一个 condis = append(condis, &pb.ConIProgress{ Btype: conf.Type, Conid: v,