mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-26 13:27:22 -04:00
Solved strange concurrency crashes due to players keypress-activating disabled buttons
This commit is contained in:
parent
bef1843cd9
commit
ee855b8d77
@ -1,6 +1,7 @@
|
||||
package com.unciv.ui.components.input
|
||||
|
||||
import com.badlogic.gdx.scenes.scene2d.Actor
|
||||
import com.badlogic.gdx.scenes.scene2d.Touchable
|
||||
import com.unciv.models.UncivSound
|
||||
|
||||
internal class ActorAttachments private constructor(actor: Actor) {
|
||||
@ -37,6 +38,7 @@ internal class ActorAttachments private constructor(actor: Actor) {
|
||||
|
||||
fun activate(type: ActivationTypes): Boolean {
|
||||
if (!this::activationActions.isInitialized) return false
|
||||
if (this.actor.touchable != Touchable.enabled) return false
|
||||
return activationActions.activate(type)
|
||||
}
|
||||
|
||||
|
@ -600,7 +600,7 @@ class WorldScreen(
|
||||
if (originalGameInfo.gameParameters.isOnlineMultiplayer) {
|
||||
try {
|
||||
game.onlineMultiplayer.updateGame(gameInfoClone)
|
||||
}catch (ex: Exception) {
|
||||
} catch (ex: Exception) {
|
||||
when (ex) {
|
||||
is MultiplayerAuthException -> {
|
||||
launchOnGLThread {
|
||||
|
Loading…
x
Reference in New Issue
Block a user