Skip to content

Commit 2a18ddb

Browse files
committed
🐛(AutoFill) 特殊情况下,无法从周围取物品
1 parent 3a235b3 commit 2a18ddb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mindustryX/features/AutoFill.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,12 @@ object AutoFill {
3434

3535
private fun tryFill(build: Building) {
3636
val player = Vars.player ?: return
37+
if (player.dead() || player.unit().stack.amount == 0) return
3738
if (build.team != player.team()
3839
|| (!fillStorageBlock.value && build.block is StorageBlock)
3940
|| (!fillDistribution.value && build.block.category == Category.distribution) || build.team != player.team()
4041
) return
41-
val item = player.unit()?.item() ?: return
42+
val item = player.unit().item() ?: return
4243
if (build.within(player, Vars.itemTransferRange) && build.acceptStack(item, 9999, player.unit()) >= minFill.value) {
4344
if (justTransferred(build)) return
4445
Call.transferInventory(player, build)

0 commit comments

Comments
 (0)