1+1礼包优化

This commit is contained in:
hahwu 2026-03-11 18:16:00 +08:00
parent ec55cda560
commit 5a05536321
2 changed files with 17 additions and 0 deletions

View File

@ -79,6 +79,16 @@ func (p *Player) ActivityFire(ChargeId int) {
log.Debug("ChargeFire err : %s", err)
return
}
if ActivityId == activity.ACT_TYPE_ADD_GIFT {
Items := activityCfg.GetActivityRewardItems(ActivityId)
if len(Items) > 0 {
err = p.HandleItem(Item, proto.ITEM_POP_LABEL_ActTypeAddGift.String())
if err != nil {
log.Debug("ChargeFire err : %s", err)
return
}
}
}
p.PlayMod.save()
p.initActivity()
p.BackDataActivity()

View File

@ -26,3 +26,10 @@ func TestWatchAd(t *testing.T) {
count = ChargeMod.GetAdWatch()
fmt.Println("观看广告次数:", count)
}
// 1+1礼包
func TestActivityGiftAdd(t *testing.T) {
p1 := new(game.Player)
p1.InitPlayer("3625212")
p1.Charge(72)
}