From 4fa60266f131a9405dc7b10e17879c7e3b2e991b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <1@72wo.cn> Date: Wed, 31 Dec 2025 02:17:43 +0800 Subject: [PATCH] =?UTF-8?q?```=20refactor(player):=20=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=AE=A0=E7=89=A9=E5=88=A0=E9=99=A4=E9=80=BB=E8=BE=91=E9=A1=BA?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将宠物列表更新操作移到背包更新和删除操作之后, 确保在删除宠物前先完成相关的服务更新操作。 ``` --- logic/service/player/base.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logic/service/player/base.go b/logic/service/player/base.go index e5463f681..766473ca9 100644 --- a/logic/service/player/base.go +++ b/logic/service/player/base.go @@ -68,10 +68,10 @@ func (f *baseplayer) FindPet(catchTime uint32) (int, *model.PetInfo, bool) { func (f *Player) PetDel(catchTime uint32) { index, olpet, ok := f.FindPet(catchTime) if ok { - f.Info.PetList = append(f.Info.PetList[:index], f.Info.PetList[index+1:]...) //先将背包更新 f.Service.Pet.UPdate(*olpet) f.Service.Pet.Pet_del(catchTime) + f.Info.PetList = append(f.Info.PetList[:index], f.Info.PetList[index+1:]...) } }