mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 05:46:43 -04:00
Catching out of memory errors when updating tiles with a catch-all popup
This commit is contained in:
parent
fda3d32332
commit
5910e52407
@ -396,8 +396,13 @@ class WorldScreen(val gameInfo: GameInfo, val viewingCiv:CivilizationInfo) : Cam
|
||||
// if we use the clone, then when we update viewable tiles
|
||||
// it doesn't update the explored tiles of the civ... need to think about that harder
|
||||
// it causes a bug when we move a unit to an unexplored tile (for instance a cavalry unit which can move far)
|
||||
if (fogOfWar) mapHolder.updateTiles(selectedCiv)
|
||||
else mapHolder.updateTiles(viewingCiv)
|
||||
|
||||
try { // Most memory errors occur here, so this is a sort of catch-all
|
||||
if (fogOfWar) mapHolder.updateTiles(selectedCiv)
|
||||
else mapHolder.updateTiles(viewingCiv)
|
||||
} catch (outOfMemoryError: OutOfMemoryError) {
|
||||
ToastPopup("Not enough memory on phone to load game!", this)
|
||||
}
|
||||
|
||||
topBar.update(selectedCiv)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user