squeek Posted November 22, 2014 Share Posted November 22, 2014 Bug Submission: Category: GeneralIssue Title: worldstate never updates elapseddaysinseason/remainingdaysinseasonIssue Description: The following lines (in components/worldstate.lua) are misplaced:SetVariable("elapseddaysinseason", data.elapseddaysinseason) SetVariable("remainingdaysinseason", data.remainingdaysinseason)They are currently in OnSeasonLengthsChanged, but they should be in OnSeasonTickSee the OnSeasonDirty and OnLengthsDirty functions in components/seasons.lua:local function OnSeasonDirty() ModifySeasonDSP(5) local data = { season = SEASON_NAMES[_season:value()], progress = 1 - (_totaldaysinseason:value() > 0 and _remainingdaysinseason:value() / _totaldaysinseason:value() or 0), elapseddaysinseason = _elapseddaysinseason:value(), remainingdaysinseason = _endlessdaysinseason:value() and ENDLESS_DAYS or _remainingdaysinseason:value(), } _world:PushEvent("seasontick", data)endlocal function OnLengthsDirty() local data = {} for i, v in ipairs(_lengths) do data[SEASON_NAMES[i]] = v:value() end _world:PushEvent("seasonlengthschanged", data)endSteps to Reproduce: TheWorld.state.elapseddaysinseason will always have the value 0 no matter what Link to comment Share on other sites More sharing options...
Developer PeterA Posted November 25, 2014 Developer Share Posted November 25, 2014 I've submitted a fix for this, you'll see the change with the next update. Thanks for reporting this bug! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.