fix(config): 修复宠物蛋系统中概率计算错误 - 修正了EggService中宠物产出概率计算时错误使用的字段名 - 将pet.OutputMons修正为pet.Probs以正确累加等级权重 refactor(player): 优化金币列表服务参数处理逻辑 - 移除未使用的gconv导入包 - 简化ModifyBefore方法中的用户ID验证逻辑 - 统一设置
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user