```
refactor(player): 调整宠物删除逻辑顺序 将宠物列表更新操作移到背包更新和删除操作之后, 确保在删除宠物前先完成相关的服务更新操作。 ```
This commit is contained in:
@@ -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:]...)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user