fix: 修正闪光宠物生成逻辑
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user