```
refactor(controller): 替换BossCompletedTask为专用方法名 在战斗控制器中将p.BossCompletedTask替换为p.SptCompletedTask, 以及在塔沃控制器中将BossCompletedTask相关调用替换为TawerCompletedTask, 以更好地区分不同的任务完成逻辑。 --- fix(item_use): 添加nil检查防止程序崩溃 在处理神经元道具时,增加对oldPet对象的nil检查, 如果为空则返回系统错误码,避免程序出现
This commit is contained in:
@@ -79,6 +79,9 @@ func (h Controller) handleNeuronItem(currentPet *model.PetInfo, c *player.Player
|
||||
|
||||
originalCatchTime := currentPet.CatchTime
|
||||
oldPet := c.Service.Pet.PetInfo_One_Unscoped(currentPet.OldCatchTime)
|
||||
if oldPet == nil {
|
||||
return errorcode.ErrorCodes.ErrSystemError
|
||||
}
|
||||
|
||||
copier.CopyWithOption(currentPet, oldPet.Data, copier.Option{DeepCopy: true})
|
||||
currentPet.CatchTime = originalCatchTime
|
||||
|
||||
Reference in New Issue
Block a user