From 14c9b1b5844e450d4fdad0bf54883abb64403e3b Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Wed, 2 Oct 2024 15:36:56 -0400 Subject: [PATCH] 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