1
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-04-15 03:22:59 +08:00
parent a58ef20fab
commit 5f47bf0589
7 changed files with 42 additions and 19 deletions

View File

@@ -20,15 +20,15 @@ func petSetExpLimit(currentPet *playermodel.PetInfo) int64 {
for simulatedPet.Level < 100 {
needExp := simulatedPet.NextLvExp - simulatedPet.Exp
if needExp <= 0 {
simulatedPet.Exp = simulatedPet.NextLvExp
simulatedPet.Level++
simulatedPet.Exp = 0
simulatedPet.Update(true)
continue
}
allowedExp += needExp
simulatedPet.Exp += needExp
simulatedPet.Level++
simulatedPet.Exp = 0
simulatedPet.Update(true)
}
@@ -99,8 +99,9 @@ func (h Controller) PetFirst(
func (h Controller) SetPetExp(
data *PetSetExpInboundInfo,
player *player.Player) (result *pet.PetSetExpOutboundInfo, err errorcode.ErrorCode) {
_, currentPet, found := player.FindPet(data.CatchTime)
if !found || currentPet.Level >= 100 {
slot, found := player.FindPetBagSlot(data.CatchTime)
currentPet := slot.PetInfoPtr()
if !found || currentPet == nil || currentPet.Level >= 100 {
return &pet.PetSetExpOutboundInfo{Exp: player.Info.ExpPool}, errorcode.ErrorCodes.ErrSystemError
}