猫猫回礼奖励补发

This commit is contained in:
hahwu 2026-04-14 20:37:42 +08:00
parent 0fbebc856e
commit ea6eaa79a4
3 changed files with 19 additions and 13 deletions

View File

@ -163,7 +163,6 @@ func (p *Player) SendActivityMail2(items []*item.Item, mail_title, mail_content
// 活动模块 零点更新
func (p *Player) ActivityZeroUpdate() {
p.CatReturnGiftZeroUpdate()
p.ActivityLogin()
type zeroHandler struct {
actType int
@ -183,14 +182,7 @@ func (p *Player) ActivityZeroUpdate() {
}
}
func (p *Player) CatReturnGiftLogin() {
activityInfo := p.GetActivityInfo(activity.ACT_TYPE_CAT_RETURN_GIFT)
var aid int
var id int
if activityInfo != nil {
id = activityInfo.Id
aid = activityInfo.AId
}
p.GetCatReturnGiftMod().Login(id, aid)
p.CatReturnGiftZeroUpdate()
}
// 猫猫回礼0点更新
@ -209,8 +201,11 @@ func (p *Player) CatReturnGiftZeroUpdate() {
items := make([]*item.Item, 0)
if cfg != nil {
for _, v := range cfg.RewardList {
if oldScore >= int(v.Score) && oldReward < int(v.Id) {
if oldScore >= int(v.Total) && oldReward < int(v.Id) {
items = append(items, item.MsgToItem(v.Reward)...)
if v.StarReward > 0 {
items = append(items, item.NewItem(item.ITEM_STAR_ID, GoUtil.FormatStarItemNum(int(v.StarReward), p.GetOrderFactor())))
}
}
}
}

View File

@ -417,8 +417,8 @@ func (p *Player) ZeroUpdate(a []interface{}) {
p.PlayroomBackData()
p.ChampionshipZeroUpdate()
p.BackChampship()
p.InitActivity()
p.ActivityZeroUpdate()
// p.InitActivity()
// p.ActivityZeroUpdate()
// 每日任务
p.PlayMod.getDailyTaskMod().ZeroUpdate(p.GetPlayerBaseMod().GetLevel(), p.GetOrderFactor(), p.GetDailyTaskActivityId())
@ -474,7 +474,7 @@ func (p *Player) Login() {
p.LimitedTimePlayroomTrigger() // playroom数值变化
LimitedTimePlayroomWorkTrigger(p) // playroom打工
LimitedTimeEnergyAdd(p) // 能量定时处理
p.ActivityLogin() // 活动登录
//p.ActivityLogin() // 活动登录
p.Compensation()
SyncMailMsg(p) // 同步邮件
Duration := BaseMod.Login()

View File

@ -0,0 +1,11 @@
package unit
import "testing"
func TestCatReturnGift(t *testing.T) {
player := getTestPlayer()
player.GetCatReturnGiftMod().AddScore(100)
player.GetCatReturnGiftMod().AId = 1776168200
player.GetCatReturnGiftMod().Id = 26
player.CatReturnGiftZeroUpdate()
}