```
feat(pet): 优化宠物仓库和背包功能的数据库操作 - 使用copier.CopyWithOption替代直接赋值,确保深拷贝操作 - 移除冗余的model导入,简化代码结构 - 重构PetReleaseToWarehouse和PetRetrieveFromWarehouse方法, 直接调用UPdateFree方法更新宠物状态 - 优化TogglePetBagWarehouse方法中的宠物数据更新逻辑 - 添加
This commit is contained in:
@@ -71,11 +71,7 @@ func (f *Player) PetDel(catchTime uint32) {
|
||||
f.Info.PetList = append(f.Info.PetList[:index], f.Info.PetList[index+1:]...)
|
||||
|
||||
//先将背包更新
|
||||
f.Service.Pet.PetInfo_One_exec(catchTime, func(petData *model.PetEX) {
|
||||
petData.Data = *olpet
|
||||
//t.InBag = 0
|
||||
|
||||
})
|
||||
f.Service.Pet.UPdate(*olpet)
|
||||
f.Service.Pet.Pet_del(catchTime)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user