yairm210 / Unciv

Open-source Android/Desktop remake of Civ V

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

World wrap does not work for spectators

SeventhM opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Game Version

4.11.1

Describe the bug

By default, Spectators don't have the flag set that allows them to scroll the map freely. I believe this has something to do with how com.unciv.logic.civilization.ExploredRegion updates explored tiles, though I'm not entirely sure what the fix is here. Do note: this bug does not affect singleplayer spectators in the built-in ruleset presumably due to them gaining every tech a the start of a game, unlike multiplayer spectators, which unlocks Satellites which does not have this issue when revealing the map. Though, I'm not sure if that's the reason or there is a different reason I'm missing

Steps to Reproduce

Open a multiplayer game as spectator

Screenshots

No response

Link to save file

No response

Operating System

Android

Additional Information

No response

I'd say your explanation is right on the money. Me for my part I wouldn't try to fix it - I don't do multipayer 🙃

I imagine something like

Index: core/src/com/unciv/ui/screens/worldscreen/WorldMapHolder.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/core/src/com/unciv/ui/screens/worldscreen/WorldMapHolder.kt b/core/src/com/unciv/ui/screens/worldscreen/WorldMapHolder.kt
--- a/core/src/com/unciv/ui/screens/worldscreen/WorldMapHolder.kt	(revision 7dfa6682e08ebd353e45aa5b81888be776224737)
+++ b/core/src/com/unciv/ui/screens/worldscreen/WorldMapHolder.kt	(date 1712564309911)
@@ -967,6 +967,7 @@
         if (exploredRegion.shouldRecalculateCoords()) exploredRegion.calculateStageCoords(maxX, maxY)
 
         if (!exploredRegion.shouldRestrictX()) return result
+        if (worldScreen.viewingCiv.isSpectator()) return result
 
         val leftX = exploredRegion.getLeftX()
         val rightX = exploredRegion.getRightX()
@@ -984,6 +985,7 @@
         var result = scrollY + deltaY
 
         if (exploredRegion.shouldRecalculateCoords()) exploredRegion.calculateStageCoords(maxX, maxY)
+        if (worldScreen.viewingCiv.isSpectator()) return result
 
         val topY = exploredRegion.getTopY()
         val bottomY = exploredRegion.getBottomY()
... but as I said can't test

Arrived independently at the same solution as SomeTrog :)