[General] - worldstate never updates elapseddaysinseason/remainingdaysinseason


squeek

Recommended Posts

Bug Submission:

Category: General

Issue Title: worldstate never updates elapseddaysinseason/remainingdaysinseason

Issue 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 OnSeasonTick

See 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)end
Steps to Reproduce: TheWorld.state.elapseddaysinseason will always have the value 0 no matter what
Link to comment
Share on other sites

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.