From 12d8ba3d1b7c29dd7e6d748a18a7338fbfb087c3 Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Wed, 2 Oct 2024 15:22:19 -0400 Subject: [PATCH 1/2] Fix crash in FindDialog --- core/src/mindustry/client/ui/FindDialog.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/core/src/mindustry/client/ui/FindDialog.kt b/core/src/mindustry/client/ui/FindDialog.kt index 5a2e5279d7..f0dca14b57 100644 --- a/core/src/mindustry/client/ui/FindDialog.kt +++ b/core/src/mindustry/client/ui/FindDialog.kt @@ -33,6 +33,7 @@ object FindDialog : BaseDialog("@client.find") { init { for ((i, img) in images.withIndex()) { img.clicked { // When image clicked, select it + if (guesses.size <= i) return@clicked val gi = guesses[i] guesses[i] = guesses[0] guesses[0] = gi From 14c9b1b5844e450d4fdad0bf54883abb64403e3b Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Wed, 2 Oct 2024 15:36:56 -0400 Subject: [PATCH 2/2] Fix autodrain crash on map end --- core/src/mindustry/client/utils/AutoTransfer.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/mindustry/client/utils/AutoTransfer.kt b/core/src/mindustry/client/utils/AutoTransfer.kt index b9ec1590ea..8103b06016 100644 --- a/core/src/mindustry/client/utils/AutoTransfer.kt +++ b/core/src/mindustry/client/utils/AutoTransfer.kt @@ -145,7 +145,7 @@ class AutoTransfer { /** Transfers outputs from blocks into core/containers */ private fun drain(): Boolean { // FINISHME: Until this class is refactored to have a more generic input output system I'm just gonna copy a lot of code into this function - core = player.closestCore() + core = player.closestCore() ?: return@drain false val nearCore = player.within(core, itemTransferRange) if (!nearCore) core = null