mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-23 06:08:46 +07:00
Fixed "Game errors when loading game" - #1171
This commit is contained in:
@ -52,6 +52,7 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
|
|||||||
|
|
||||||
private val notificationsScroll: NotificationsScroll
|
private val notificationsScroll: NotificationsScroll
|
||||||
var alertPopupIsOpen = false // if we have an alert popup and then we changed screens, the old one shouldn't affect us
|
var alertPopupIsOpen = false // if we have an alert popup and then we changed screens, the old one shouldn't affect us
|
||||||
|
var shouldUpdate=false
|
||||||
|
|
||||||
init {
|
init {
|
||||||
topBar.setPosition(0f, stage.height - topBar.height)
|
topBar.setPosition(0f, stage.height - topBar.height)
|
||||||
@ -112,7 +113,6 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
|
|||||||
}
|
}
|
||||||
tileMapHolder.setCenterPosition(tileToCenterOn,true)
|
tileMapHolder.setCenterPosition(tileToCenterOn,true)
|
||||||
|
|
||||||
update()
|
|
||||||
|
|
||||||
if(gameInfo.gameParameters.isOnlineMultiplayer && !gameInfo.isUpToDate)
|
if(gameInfo.gameParameters.isOnlineMultiplayer && !gameInfo.isUpToDate)
|
||||||
isPlayersTurn = false // until we're up to date, don't let the player do anything
|
isPlayersTurn = false // until we're up to date, don't let the player do anything
|
||||||
@ -121,6 +121,10 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
|
|||||||
loadLatestMultiplayerState()
|
loadLatestMultiplayerState()
|
||||||
}, Actions.delay(10f)))) // delay is in seconds
|
}, Actions.delay(10f)))) // delay is in seconds
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// don't run update() directly, because the UncivGame.worldScreen should be set so that the city buttons and tile groups
|
||||||
|
// know what the viewing civ is.
|
||||||
|
shouldUpdate=true
|
||||||
}
|
}
|
||||||
|
|
||||||
fun loadLatestMultiplayerState(){
|
fun loadLatestMultiplayerState(){
|
||||||
@ -409,8 +413,6 @@ class WorldScreen(val viewingCiv:CivilizationInfo) : CameraStageBaseScreen() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var shouldUpdate=false
|
|
||||||
|
|
||||||
|
|
||||||
override fun render(delta: Float) {
|
override fun render(delta: Float) {
|
||||||
// This is so that updates happen in the MAIN THREAD, where there is a GL Context,
|
// This is so that updates happen in the MAIN THREAD, where there is a GL Context,
|
||||||
|
Reference in New Issue
Block a user