From 1f1400f1012eba8c562b6fdf174d1deada86577b Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 16 Oct 2024 10:32:05 +0800 Subject: [PATCH] 1 --- server/matchserver/player/player.go | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/server/matchserver/player/player.go b/server/matchserver/player/player.go index 19d2c7af..b99c8e44 100644 --- a/server/matchserver/player/player.go +++ b/server/matchserver/player/player.go @@ -69,26 +69,6 @@ func (this *player) parseUserInfo(userInfo *common.UserInfo){ q5.DuckToSimple(userInfo.VipExp, &this.vipExp) q5.DuckToSimple(userInfo.HasVipLucky, &this.hasVipLucky) q5.DuckToSimple(userInfo.HasLuckySymbol, &this.hasLuckySymbol) - { - found := false - index := 0 - for _, val := range this.battleItems { - index++ - if val.ItemId == constant.LUCKY_SYMBOL_ITEM_ID { - found = true - break - } - } - if this.hasLuckySymbol != 0 { - if !found { - } - } else { - if found { - copy(this.battleItems[index:], this.battleItems[index+1:]) - this.battleItems = this.battleItems[:len(this.battleItems)-1] - } - } - } } func (this *player) parseHeroInfo(heroInfo *common.HeroInfo){ @@ -273,6 +253,13 @@ func (this *player) FillMFTeamMember(member_pb *cs.MFTeamMember) { item_pb.ItemNum = proto.Int32(p.ItemNum) q5.AppendSlice(&member_pb.BattleItems, item_pb) } + if this.hasLuckySymbol != 0 && + this.team.GetModeId() == 0{ + item_pb := new(cs.MFBattleItem) + item_pb.ItemId = proto.Int32(constant.LUCKY_SYMBOL_ITEM_ID) + item_pb.ItemNum = proto.Int32(1) + q5.AppendSlice(&member_pb.BattleItems, item_pb) + } } func (this *player) CMLeaveTeam(hdr *f5.MsgHdr, msg *cs.CMLeaveTeam) {