fix: 修正闪光宠物生成逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
xinian
2026-03-21 23:02:33 +08:00
committed by cnb
parent 4ba8fe32c4
commit 61b0d6093f

View File

@@ -42,14 +42,18 @@ func init() {
}
func (c *PetBagController) GetSession(ctx context.Context, req *PetGetReq) (res *cool.BaseRes, err error) {
var shiny []data.GlowFilter
if req.IsShiny != 0 {
if req.IsShiny > 0 {
r := config.NewShinyService().GetShiny(req.IsShiny)
shiny = append(shiny, *r)
}
t := model.GenPetInfo(
req.PetTypeId, req.IndividualValue, req.NatureId, req.AbilityTypeEnum, req.Level, shiny, -1)
req.PetTypeId, req.IndividualValue, req.NatureId, req.AbilityTypeEnum, req.Level, shiny, 0)
t.CatchRect = 1 //代表这是人工合成的
if req.IsShiny == -1 {
t.RandomByWeightShiny()
}
service.NewUserService(uint32(req.UserID)).Pet.PetAdd(t, 0)
return