Jump to content

Value in components.growable:Resume() function is set to nil, then asked to be used, resulting in a crash?


Scrimbles
  • Fixed

Axe found an issue when skipping time, where a math.max calculation fails to find its max, because the variable it needs is set to nil inside the same block.

 

Check it out:

function Growable:Resume()
    if self.pausedremaining ~= nil then
        self.pausedremaining = nil  <-- Why is self.pausedremaining set to nil...
        local _usetimemultiplier = self.usetimemultiplier
        self:StartGrowing(math.max(0, self.pausedremaining)) <-- Then asked to give a value here?
        self.usetimemultiplier = _usetimemultiplier
        return true
    end
end

The current Live code looks like this:
 

function Growable:Resume()
    if self.pausedremaining ~= nil then
        local remainingtime = math.max(0, self.pausedremaining)
        self.pausedremaining = nil
        self:StartGrowing(remainingtime)
        return true
    end
end

 

Unsure why the change was made, but it seems to crash the game when called, sometimes.


Steps to Reproduce

As far as I can tell, calling for growable:Resume() just seems to fail to find a value sometimes.




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.


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...