```
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

fix(config): 修复宠物蛋系统中概率计算错误

- 修正了EggService中宠物产出概率计算时错误使用的字段名
- 将pet.OutputMons修正为pet.Probs以正确累加等级权重

refactor(player): 优化金币列表服务参数处理逻辑

- 移除未使用的gconv导入包
- 简化ModifyBefore方法中的用户ID验证逻辑
- 统一设置
This commit is contained in:
昔念
2026-03-19 15:08:14 +08:00
parent b558f46d7a
commit baf0d1fc06
2 changed files with 2 additions and 7 deletions

View File

@@ -43,7 +43,7 @@ func (s *EggService) GetResult(m, f, level uint32) (uint32, bool) {
md.Wheref(`male_pet_ids @> ARRAY[?]::integer[]`, m).
Wheref(`female_pet_ids @> ARRAY[?]::integer[]`, f).Scan(&pet)
if pet != nil {
pet.OutputMons[len(pet.OutputMons)-1] += int32(level)
pet.Probs[len(pet.OutputMons)-1] += int32(level)
t, _ := utils.RandomByWeight(pet.OutputMons, pet.Probs)
if pet.OutputMons[len(pet.OutputMons)-1] == int32(t) {
return uint32(t), true