【猫草大作战】-领奖逻辑优化

This commit is contained in:
hahwu 2025-12-09 17:28:30 +08:00
parent af72af6ec4
commit d17992a6f1

View File

@ -191,7 +191,11 @@ func (c *CatnipMod) Reward(Id, Progress int) ([]*item.Item, *CatnipGame, error)
return nil, nil, fmt.Errorf("reward for progress %d has already been claimed in game ID %d", Progress, Id)
}
GameInfo.Reward = append(GameInfo.Reward, Progress)
return catnipCfg.GetProgressReward(c.Id, Progress), GameInfo, nil
Items := catnipCfg.GetProgressReward(c.Id, Progress)
if Items == nil {
return nil, nil, fmt.Errorf("no reward found for progress %d in game ID %d", Progress, Id)
}
return Items, GameInfo, nil
}
func (c *CatnipMod) GrandReward() ([]*item.Item, error) {