• Tracker

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

Bug in weather code can cause Sandstorm that lasts for 27 hours when server restarts during.

Environment
1

State

Open
Issue key
DZG-2974
Access
Public
Space
DayZ
Project
Stable Feedback
Creator
jedjustjed
Created
Nov 22, 2026
Views
2
Platform
Playstation
What happened?

Sandstorm had just started and server was restarted manually about 10 minutes in. Three hours later after restart and the sandstorm is still blowing.

A look at the code seems to show an error where there are two states stored for the sandstorm and they can disagree after a restart.

Reproduction steps

As best as I can figure this out:

  1. Sandstorm starts via the normal weather flow. StartSandstorm() sets m_IsSandstormStartedByWeather = true (worlddata.c:482) a session-local note that the storm was weather-driven.

  2. Server restarts mid-storm. Script members re-initialise: worlddata.c:47 - m_IsSandstormStartedByWeather returns to false. The note is not persisted.

  3. Native sandstorm resumes from weather storage. sandstorm.c:90 raises OnStart(continuedSession = true); sandstorm.c:95 forwards to GetWorldData().WeatherSandstormStart(continuedSession).

  4. worlddata.c:501 reads m_IsSandstormStartedByWeather -> false which is stale information belonging to the previous session. A weather-driven storm is reported as not weather-driven.

  5. worlddata.c:510 calls OnSandstormStart(false) -> override nasdara.c:497.

  6. nasdara.c:499 - if (!isStartedByWeather) enters the branch intended for manually started storms. nasdara.c:504-507 set wind magnitude and wind direction forecasts with length 99999 s; nasdara.c:508 sets overcast to RandomFloatInclusive(0.75, 1.0) with forecast length 99999 s (~27.7 hours).

  7. The only sandstorm.Stop() calls are nasdara.c:339 and nasdara.c:357, both inside case EWeatherPhenomenon.OVERCAST: of WeatherOnBeforeChange (nasdara.c:172,204), which executes when the overcast forecast phase ends. The phase was just set to 99999 s, so the handler cannot fire and the storm runs unmanaged for ~27.7 hours. Compare the weather-flow start path, which relies on the same mechanism (nasdara.c:330 - windMagLength = 99999 with comment "we want sandstorm to stay in the map until the next real overcast change") - that path is safe only because a normal-length overcast phase still exists. Here it does not.

I ran a Monte Carlo test against the code and got a consistent result - simulated restart during a sandstorm always triggered the error that made the storm last 27.7 hours.

I think the fix is not to use 99999 but maximum overcast length:

- m_Weather.GetOvercast().Set( randomizedOvercast , fadeInTime * 2, 99999);
+ m_Weather.GetOvercast().Set( randomizedOvercast , fadeInTime * 2, m_WeatherDefaultSettings.m_OvercastMaxLength);
Exact build version (optional)
1.30.164289.70
Where did it happen?
Community
Is it modded?
No
Expected result
—
Reactions

Activity

    17 minutes ago
  • jedjustjed
    created issue17 minutes ago

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

State

Open
Issue key
DZG-2974
Access
Public
Space
DayZ
Project
Stable Feedback
Creator
jedjustjed
Created
Nov 22, 2026
Views
2