This commit is contained in:
@@ -45,7 +45,18 @@ func (s *EggService) Get() (out *model.Egg) {
|
||||
|
||||
}
|
||||
func (s *EggService) StartBreed(m, f *model.PetInfo) bool {
|
||||
|
||||
if m.Gender != 1 {
|
||||
return false
|
||||
}
|
||||
if f.Gender != 2 {
|
||||
return false
|
||||
}
|
||||
if m.Generation > 9 {
|
||||
return false
|
||||
}
|
||||
if f.Generation > 9 {
|
||||
return false
|
||||
}
|
||||
var tt *model.Egg
|
||||
s.TestModel(s.Model).Scan(&tt)
|
||||
if tt == nil {
|
||||
@@ -61,10 +72,8 @@ func (s *EggService) StartBreed(m, f *model.PetInfo) bool {
|
||||
|
||||
cureff.EggCatchTime = uint32(time.Now().Unix())
|
||||
|
||||
cureff.EggID = (uint32(m.Generation) + uint32(f.Generation)) / 2
|
||||
if cureff.EggID == 0 {
|
||||
cureff.EggID = 1
|
||||
}
|
||||
cureff.EggID = (uint32(m.Generation)+uint32(f.Generation))/2 + 1
|
||||
|
||||
cureff.OwnerID = uint32(s.userid)
|
||||
|
||||
cureff.FeMalePetID = f.ID
|
||||
|
||||
Reference in New Issue
Block a user