• Tracker

    Spaces
    Browse
    Statistics
  • /
  • /Stable Feedback
  • /DZG-3134
Back
1

Headgear sun protection: drenched hats count as bare head, warm hats add sun heat, no sun heat on Chernarus

CharacterEnvironment
1

State

Open
Issue key
DZG-3134
Access
Public
Space
DayZ
Project
Stable Feedback
Creator
zoro
Created
Dec 3, 2026
Views
3
Platform
PC Steam
What happened?

Players report that headgear doesn't protect against the sun on Chernarus and that a soaked hat doesn't protect. Both are true. Environment.SunProtectionCoef() reads the headgear slot correctly; the causes are in the values it uses:

1. Drenched headgear counts as a bare head. MiscGameplayFunctions.GetCurrentItemHeatIsolation() returns ENVIRO_ISOLATION_WETFACTOR_DRENCHED (-0.15) directly for items at wetness 0.8 or more. SunProtectionCoef() then sees isolation <= 0 and returns HC_EXPOSED_HEAD_TO_SUN (1.2), the bare-head value. A hat dipped in water is drenched, so it gives no protection until it dries to "soaking wet", where it suddenly gives the best protection of any state. Sun factor for a baseball cap (heatIsolation 0.2), bare head 1.2:

dry           0.2 x 1.2 + 0.4 = 0.64
wet           0.1 x 1.2 + 0.4 = 0.52
soaking wet  0.02 x 1.2 + 0.4 = 0.42
drenched     isolation -0.15  = 1.20  (same as no hat)

In reality a wet hat cools the head by evaporation, so a drenched hat should protect at least as well as a dry one.

2. Warm headgear adds sun heat. The factor is isolation * 1.2 + 0.4, so it is above the bare-head 1.2 for any headgear with heatIsolation above 0.67: beanie 1.24, Gorka helmet and radar cap 1.36, ushanka, Santa's hat and witch hat 1.60. Wearing them in the sun is up to 33 % hotter than wearing nothing on the head. Their insulation already warms the player through the normal clothing heat comfort, so here it counts a second time. Only thin headgear protects (caps and berets 0.64, boonie 0.76).

3. Chernarus, Livonia and Sakhal have no sun heat at all. WorldData.m_TemperatureUnderSunModifier is created empty in WorldData.Init() and only NasdaraData fills it (2 / 6 / 8 / 4 / 2 / 0 / 0 for dawn to night). On the other maps WorldDataDaytime.IsInRange() finds no key, so GetSunEffectOnTemperature() is never added and headgear has nothing to protect against. If that is intended, players will keep reporting the headgear fix as broken there; if not, those maps need values too.

Reproduction steps
  1. On Nasdara, clear sky at noon, stand in the sun wearing clothes and a baseball cap. Note the environment temperature in the debug monitor or heat comfort.

  2. Dip the cap in water until it is drenched (inspect shows "Drenched") and put it back on: the sun heat is the same as with no headgear.

  3. Swap the cap for an ushanka: the sun heat is higher than with no headgear.

  4. Repeat step 1 on Chernarus: standing in the sun adds no heat with or without headgear.

Exact build version (optional)
1.30.164423
Where did it happen?
Community
Is it modded?
No
Expected result

Any headgear lowers the sun heat compared to a bare head, a wet or drenched hat protects at least as well as a dry one (evaporation), and headgear insulation doesn't increase the sun heat. Either all maps with a sun get sun heat, or the protection is explained as Nasdara-only.

Suggested fix

Base the protection on the headgear being there (shade) and being wet (evaporation), not on its heat isolation. GetCurrentItemHeatIsolation() stays as it is, since its negative drenched value is right for warmth.

protected const float HC_EXPOSED_HEAD_TO_SUN = 1.2;    // existing
protected const float HC_HEADGEAR_SUN = 0.8;      // shade
protected const float HC_WET_HEADGEAR_SUN = 0.6;  // shade + evaporative cooling

private float SunProtectionCoef()
{
	GameInventory playerInventory = m_Player.GetInventory();
	foreach (int slotId : m_SunProtectionSlots)
	{
		ItemBase attachment = ItemBase.Cast(playerInventory.FindAttachment(slotId));
		if (attachment && attachment.IsClothing() && !attachment.IsRuined())
		{
			if (attachment.GetWet() >= GameConstants.STATE_WET)
				return HC_WET_HEADGEAR_SUN;
			return HC_HEADGEAR_SUN;
		}
	}
	return HC_EXPOSED_HEAD_TO_SUN;
}

If brims should matter (a boonie or cowboy hat shades more than a beanie), a per-item config value such as sunProtection could replace the two constants.

For the maps without sun heat, the same table as Nasdara's but weaker for the colder climate, e.g. in ChernarusPlusData.Init() (and Enoch / Sakhal):

m_TemperatureUnderSunModifier[WorldDataDaytime.DAWN] = 1.0;
m_TemperatureUnderSunModifier[WorldDataDaytime.MORNING] = 3.0;
m_TemperatureUnderSunModifier[WorldDataDaytime.NOON] = 5.0;
m_TemperatureUnderSunModifier[WorldDataDaytime.AFTERNOON] = 3.0;
m_TemperatureUnderSunModifier[WorldDataDaytime.EVENING] = 1.0;
m_TemperatureUnderSunModifier[WorldDataDaytime.DUSK] = 0.0;
m_TemperatureUnderSunModifier[WorldDataDaytime.NIGHT] = 0.0;
Reactions

Activity

    15 minutes ago
  • zoro
    created issue15 minutes ago

You are not signed in. Please sign in to see more details and to reply.

State

Open
Issue key
DZG-3134
Access
Public
Space
DayZ
Project
Stable Feedback
Creator
zoro
Created
Dec 3, 2026
Views
3