In stategraphs/SGthunderbird.lua:
State{ name= "idle", tags = {"idle", "canrotate"}, onenter = function(inst) if inst.fx and math.random() < 0.1 then inst.fx.AnimState:PlayAnimation("idle") end inst.components.locomotor:Stop() inst.AnimState:PlayAnimation("idle") end, events= { EventHandler("animover", function(inst) inst.sg:GoToState("idle") end ), }, },
When the entity goes asleep and come back again, it somehow first go to its default state, then enter whatever state it was before going asleep. Therefore whenever a thunderbird goes off screen and come back, onenter calls LocoMotor:Stop, which sets LocoMotor.dest to nil, causing it to stop moving. It's easy to see LocoMotor.dest changing to nil if you select the entity and look at LocoMotor's debug string.
This can be easily fixed by changing LocoMotor:Stop to LocoMotor:StopMoving.
Steps to Reproduce
Chase a thunderbird out of its nest
Wait for it to go back and leave loading range
Come back and it stops
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