refactor(controller): 替换BossCompletedTask为专用方法名

在战斗控制器中将p.BossCompletedTask替换为p.SptCompletedTask,
以及在塔沃控制器中将BossCompletedTask相关调用替换为TawerCompletedTask,
以更好地区分不同的任务完成逻辑。

---

fix(item_use): 添加nil检查防止程序崩溃

在处理神经元道具时,增加对oldPet对象的nil检查,
如果为空则返回系统错误码,避免程序出现
This commit is contained in:
昔念
2026-01-20 04:40:36 +08:00
parent 562bf380eb
commit fcb55d3a46
12 changed files with 52 additions and 17 deletions

View File

@@ -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