Opened 8 years ago

Last modified 5 years ago

#4070 new defect

Update fog of war immediately when joining a paused game or changing the perspective

Reported by: elexis Owned by:
Priority: Must Have Milestone: Backlog
Component: UI – In-game Keywords:
Cc: Imarok, echotangoecho Patch:

Description (last modified by elexis)

The fog of war is only updated when a turn is processed. This means after changing the perspective, the observer has to wait a bit until the fog of war of the selected player is displayed.

When rejoining a paused game and when changing the perspective if it's paused doesn't update the fog of war until it's unpaused. This would be especially important for #4009.

See SetViewedPlayerID of Game.cpp.

Change History (4)

comment:1 by elexis, 8 years ago

Cc: Imarok echotangoecho added
Priority: Should HaveMust Have
Summary: Update fog of war immediately when changing the perspectiveUpdate fog of war immediately when joining a paused game or changing the perspective

comment:2 by elexis, 8 years ago

This fixes the fog of war but not the displaying of units and silhouettes.

diff --git a/source/ps/Game.cpp b/source/ps/Game.cpp
index 344cccf..bcb2448 100644
--- a/source/ps/Game.cpp
+++ b/source/ps/Game.cpp
@@ -360,6 +360,12 @@ int CGame::GetViewedPlayerID()
 void CGame::SetViewedPlayerID(player_id_t playerID)
 {
        m_ViewedPlayerID = playerID;
+
+       if (m_GameView)
+       {
+               m_GameView->GetLOSTexture().MakeDirty();
+               m_GameView->GetLOSTexture().InterpolateLOS();
+       }
 }
 
 void CGame::StartGame(JS::MutableHandleValue attribs, const std::string& savedState)

Tried setting m_GlobalVisibilityUpdate to false and calling UpdateVisibilityData of the RangeManager, but that wasn't it.

comment:3 by elexis, 7 years ago

Description: modified (diff)

A seemingly good way to test this is starting a replay with multiple players and a non-revealed map without any turns in it.

comment:4 by Imarok, 5 years ago

Component: UI & SimulationIn-game UI

Move tickets to In-game UI as UI & Simulation got some sub components.

Note: See TracTickets for help on using tickets.