I have a mod that has a prefab that can taunt surrounding enemies, using forced components.combat:SetTarget(). It normally works fine.
However, I got this crash with bird_mutant_splitter: https://pastebin.com/k01WM8Fg
I'm pretty familiar with this bug, it's often due to some code set components.combat.target directly without using SetTarget, thus combat.losetargetcallback never set, then when my prefab calls forced SetTarget, it crashes from assertion error.
I find these code that may have caused the issue:
bird_mutant_brain.lua:75
local function AttackTarget(inst)
local target = CanBirdAttack(inst)
if target then
inst.components.combat.target = target
inst:PushEvent("doattack")
end
end
and SGbird_mutant.lua:150
timeline=
{
TimeEvent(8*FRAMES, function(inst)
inst.components.combat:DoAttack()
inst.sg:RemoveStateTag("attack")
inst.sg:RemoveStateTag("busy")
inst.components.combat.target = nil
end ),
},
I guess it's more likely the AttackTarget one.
Please fix this, thanks.
- I spawned Abigail.
- I c_spawned 5 mutant bird splitter + 1 of my prefab (called mutantdefenderbee).
- After a few times, it would crash.
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now