Restore visiblity on sim reset in Atlas

The LOS override for all players isn't serialized as such we have to
restore it when resetting a game.

Fixes: #8926
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser
2026-05-29 19:17:58 +02:00
parent 628713859f
commit 02d9a083aa
@@ -38,6 +38,7 @@
#include "renderer/SceneRenderer.h"
#include "renderer/backend/ISwapChain.h"
#include "simulation2/Simulation2.h"
#include "simulation2/components/ICmpRangeManager.h"
#include "simulation2/components/ICmpParticleManager.h"
#include "simulation2/components/ICmpPathfinder.h"
#include "simulation2/system/Component.h"
@@ -372,6 +373,12 @@ void AtlasViewGame::RestoreState(const std::wstring& label)
return;
simState->Thaw();
// LOS override setting isn't part of the sim state as such we have to set
// it again when restoring a game.
CmpPtr<ICmpRangeManager> cmpRangeManager{*g_Game->GetSimulation2(), SYSTEM_ENTITY};
if (cmpRangeManager)
cmpRangeManager->SetLosRevealWholeMapForAll(true);
}
std::wstring AtlasViewGame::DumpState(bool binary)