fix: 修复Effect初始化空指针问题
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed

This commit is contained in:
xinian
2026-03-08 17:48:34 +08:00
committed by cnb
parent 3b1aa450df
commit c154302af4
2 changed files with 7 additions and 4 deletions

View File

@@ -80,9 +80,12 @@ func geteffect[T int | byte | uint16](etype EnumEffectType, id T) Effect {
}
return nil
}
func (our *Input) InitEffect(etype EnumEffectType, id int) Effect {
func (our *Input) InitEffect(etype EnumEffectType, id int, a ...int) Effect {
ret := geteffect(etype, id)
ret.SetArgs(our) //输入参数是对方
if ret != nil {
ret.SetArgs(our, a...) //输入参数是对方
}
return ret
}