Jump to content

Sleeping in Fur Roll fails to affect temperature because


Friendly Grass
  • Known Issue

Issue:

The Fur Roll lacks it's intended temperature effect.

Reason:

In the `temperaturetick` function in prefabs/bedroll.lua:34, `inst.sleep_temp_min` and `inst.sleep_temp_max` values are checked to see if the player temperature should be raised/lowered. But inside the `bedroll_fuzzy` constructor in lines 115-116, `sleep_temp_min` and `sleep_temp_max` fields are actually put within its sleepingbag component, `inst.components.sleepingbag`.

Fix:

One fix would be to modify the lines 34-42 of prefabs/bedroll.lua below

local function temperaturetick(inst, sleeper)
    if sleeper.components.temperature ~= nil then
        if inst.sleep_temp_min ~= nil and sleeper.components.temperature:GetCurrent() < inst.sleep_temp_min then
            sleeper.components.temperature:SetTemperature(sleeper.components.temperature:GetCurrent() + TUNING.SLEEP_TEMP_PER_TICK)
        elseif inst.sleep_temp_max ~= nil and sleeper.components.temperature:GetCurrent() > inst.sleep_temp_max then
            sleeper.components.temperature:SetTemperature(sleeper.components.temperature:GetCurrent() - TUNING.SLEEP_TEMP_PER_TICK)
        end
    end
end

to the following:

local function temperaturetick(inst, sleeper)
    if sleeper.components.temperature ~= nil and inst.components.sleepingbag ~= nil then
        if inst.components.sleepingbag.sleep_temp_min ~= nil and sleeper.components.temperature:GetCurrent() < inst.components.sleepingbag.sleep_temp_min then
            sleeper.components.temperature:SetTemperature(sleeper.components.temperature:GetCurrent() + TUNING.SLEEP_TEMP_PER_TICK)
        elseif inst.components.sleepingbag.sleep_temp_max ~= nil and sleeper.components.temperature:GetCurrent() > inst.components.sleepingbag.sleep_temp_max then
            sleeper.components.temperature:SetTemperature(sleeper.components.temperature:GetCurrent() - TUNING.SLEEP_TEMP_PER_TICK)
        end
    end
end

IMPORTANT NOTE:

TUNING.SLEEP_TEMP_PER_TICK would need to be increased for the Fur Roll to cancel out the cooling of cold weather. Otherwise it can mostly only break even in early winter. An alternative would be to disable weather cooling effects while sleeping in a Fur Roll.


Steps to Reproduce

Use Fur Roll while freezing in winter

  • Like 1



User Feedback


honestly wouldn't one just use earmuffs in the situation where onesleeps in the cold? that'd reduce the cooling.

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