Skip to content

Commit

Permalink
Fix autodrain crash on map end
Browse files Browse the repository at this point in the history
  • Loading branch information
buthed010203 committed Oct 2, 2024
1 parent 12d8ba3 commit 14c9b1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/mindustry/client/utils/AutoTransfer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 14c9b1b

Please sign in to comment.