This commit is contained in:
@@ -47,19 +47,19 @@ func (h Controller) PetFusion(data *pet.C2S_PetFusion, c *player.Player) (result
|
||||
if Auxpetinfo.Nature == Mcatchpetinfo.Nature {
|
||||
natureId = int32(Auxpetinfo.Nature)
|
||||
}
|
||||
for _, v := range data.Item1 {
|
||||
if c.Service.Item.CheakItem(v) == 0 {
|
||||
return result, errorcode.ErrorCodes.ErrInsufficientItems
|
||||
}
|
||||
|
||||
}
|
||||
resid := int(service.NewPetFusionService().Data(Mcatchpetinfo.ID, Auxpetinfo.ID, Mcatchpetinfo.Level+Auxpetinfo.Level))
|
||||
effect := int(service.NewPetFusionMaterialService().Data(data.Item1))
|
||||
|
||||
if effect == 0 {
|
||||
return result, errorcode.ErrorCodes.ErrSpiritOrbNotExists
|
||||
}
|
||||
for _, v := range data.Item1 {
|
||||
if c.Service.Item.CheakItem(v) == 0 {
|
||||
return &pet.PetFusionInfo{}, 0
|
||||
}
|
||||
|
||||
}
|
||||
for _, v := range data.Item1 {
|
||||
c.Service.Item.UPDATE(v, -1)
|
||||
|
||||
|
||||
@@ -29,8 +29,11 @@ func (s *EggService) Get() (out *model.Egg) {
|
||||
s.TestModel(s.Model).Scan(&out)
|
||||
if out != nil {
|
||||
BreedLeftTime := int64(out.Data.StartTime+out.CurEgg.EggID*uint32(time.Hour/1000000000)) - (time.Now().Unix())
|
||||
if cool.Config.ServerInfo.IsVip != 0 {
|
||||
BreedLeftTime = 0
|
||||
}
|
||||
//判断是否繁殖完成
|
||||
if BreedLeftTime < 0 && out.Data.HatchState == 1 {
|
||||
if BreedLeftTime <= 0 && out.Data.HatchState == 1 {
|
||||
out.Data.HatchState = 2
|
||||
} else {
|
||||
out.Data.HatchLeftTime = uint32(BreedLeftTime)
|
||||
|
||||
Reference in New Issue
Block a user