fix(logic/service/fight/effect): 修复技能实体为空时的空指针异常
在 effect_32.go 的 Action_start 方法中添加了对 SkillEntity 是否为 nil 的检查, 避免在技能实体不存在的情况下访问其属性导致程序崩溃。
This commit is contained in:
@@ -25,6 +25,9 @@ func (e *Effect32) Action_start(a, b *action.SelectSkillAction) bool {
|
|||||||
if !e.Hit() {
|
if !e.Hit() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
if e.Ctx().SkillEntity == nil {
|
||||||
|
return true
|
||||||
|
}
|
||||||
e.Ctx().SkillEntity.Crit += 1
|
e.Ctx().SkillEntity.Crit += 1
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user