Jump to content

Crash when W.A.R.B.O.T. finds Chilled Amulet as a target for missiles


loganpea
  • Fixed

 I was testing to see if the Chilled Amulet made you untargetable by this attack while equipped. Not only does that not work, the game crashes!

 


Steps to Reproduce

c_spawn("wagboss_robot").sg:GoToState("missiles_pre2"); c_spawn("blueamulet")
When W.A.R.B.O.T. finds a Chilled Amulet as a target for the missile attack, the game will crash.
Crash traces to SGwagboss_robot.lua at line 37
I found why this crash occurs, explained in the reply below

  • Like 1



User Feedback


A developer has marked this issue as fixed. This means that the issue has been addressed in the current development build and will likely be in the next update.

The reason for the crash may not only be due to the ice amulet, it may also be the Ice Cube

Edited by secretgalaxy

Share this comment


Link to comment
Share on other sites

function Heater:GetHeat(observer) --function used in sgwagboss_robot
    return (self.heatfn ~= nil and self.heatfn(self.inst, observer))
        or self.heat
end

function Heater:GetEquippedHeat(observer) --is not being used in sgwagboss_robot, so in some cases it is not able to get equippedheat, so it is returned nil
    return (self.equippedheatfn ~= nil and self.equippedheatfn(self.inst, observer))
        or self.equippedheat
end
--blueamulet, icehat, watermelonhat and minifan (Whirly Fan) is tagged HASHEATER and is targeted, but does not have a .heat value, so all of these crash.

 

Share this comment


Link to comment
Share on other sites

The main thing is that the heater functions returning nil is a valid result, the temperature component accounts for it, SGwagboss just needs to account for that too. There's already a bit of code in there that accounts for it:

--for other things that don't setup thermics
temperature = heater:GetHeat(v) or temperature
endo = temperature < ambient_temp

 

Regarding equipped heat, and carried heat, they shouldn't be needed to be acquired because equipped or carried items are in limbo, which the search won't find. Although I guess you could make an exception for the blue amulet and ice hat to get some sort of value when they're on the ground (not sure if blue amulet is normally cold or not, we know it doesn't emit cold when on the ground, otherwise the player would be able to use that, but the ice hat is literally made out of ice).

Share this comment


Link to comment
Share on other sites



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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...