If you get cold outside of winter, there's no overlay warning (and the sounds that play from it) unless you're inside an Ice Crystaleyezer's range. You just start taking damage out of nowhere.
This is due to an extra check for temperature being below 0 (enough to take cold damage), or that the current season is winter or local temperature is below 0, as of the last update. This can be a problem at times and could actually end up killing you if low on health, especially at the start of spring if it's already raining a lot (had it happen to a friend).
Here's what I found in regards to the code, in the following file:
- data\scripts\widgets\icecover.lua
Seems like in the IceOver:OnIceChange() function, specifically at line 50, shown below:
local isup = false while all_up_thresh[self.laststep + 1] ~= nil and temp < all_up_thresh[self.laststep + 1] and self.laststep < num_steps and (temp < 0 or TheWorld.state.iswinter or GetLocalTemperature(self.owner) < 0) --right here self.laststep = self.laststep + 1 isup = true end
One of the checks to allow show the freezing overlay is that the temperature has to be below 0 degrees, which is when we start taking cold damage, otherwise the season has to be winter or local temperature has to be 0. The thresholds table indicates the first step is at when below 5 degrees, as shown below:
local all_up_thresh = {5, 0, -5, -10}
For comparison, this is how its handled for overheating, in the file:
- data\scripts\widgets\heatover.lua
In the HeatOver:OnHeatChange() function, at line 68, shown below:
local isup = false while all_up_thresh[self.laststep+1] ~= nil and temp > all_up_thresh[self.laststep+1] and self.laststep < num_steps and (temp >= 65 or TheWorld.state.issummer or GetLocalTemperature(self.owner) >= 65) do --right here self.laststep = self.laststep + 1 isup = true end
With the thresholds being:
local all_up_thresh = {65, 70, 75, 80}
Whereas 70 is the overheating temperature, and 65 is the first step for the overlay to show, and it matches in the code above.
It probably doesn't help that a lot of these values are hard-coded into the functions instead of retrieving values from settings from elsewhere (like tuning.lua), and it's hard to tell if this intentional as a design choice for cold damage outside of winter not showing a "freezing" warning since there's not "freezing cold" happening, it's that we're cold (like from wetness/moisture being too high), or if this is a bug or oversight.
If it's intentional, then some sort of warning is needed. If it's not, it's a simple fix.
(temp < 0 or TheWorld.state.iswinter or GetLocalTemperature(self.owner) < 0) do
Could be removed entirely, as it's completely arbitrary, both from here, along with its overheating equivalent in HeatOver, even if it works fine there (which begs the question why these checks are even a thing).
IceOver also seems to have no anti-spam prevention for each sound, so I added that as well, but this is more entirely optional really. Borrowed from HeatOver and singleplayer Don't Starve.
local freeze_sounds_names = { "freeze_1st", "freeze_2nd", "freeze_3rd", "freeze_4th", }
if isup then -- Check if the sound is playing so it doesn't get spammed when temp dances back and forth across the threshold if not TheFrontEnd:GetSound():PlayingSound(freeze_sounds_names[self.laststep]) then TheFrontEnd:GetSound():PlaySound(freeze_sounds[self.laststep], freeze_sounds_names[self.laststep]) end
- Get cold through any method outside of winter (wetness, endothermic fires, a chill amulet, etc), without being inside an Ice Crystaleyezer's range.
- Lower your temperature enough to take cold damage.
- Notice how there won't be a warning prior to taking damage.
-
2
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 accountSign in
Already have an account? Sign in here.
Sign In Now