From b4d9b73a99ccd77dd7adc620c9d28f9ba2c80343 Mon Sep 17 00:00:00 2001 From: immibis Date: Tue, 5 Feb 2013 19:33:04 +1300 Subject: [PATCH] Removed any possibility of TransactorSimple entering an infinite loop when getPartialSlot and addToSlot disagree. --- common/buildcraft/core/inventory/TransactorSimple.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/buildcraft/core/inventory/TransactorSimple.java b/common/buildcraft/core/inventory/TransactorSimple.java index d4dbab17..3aeff78e 100644 --- a/common/buildcraft/core/inventory/TransactorSimple.java +++ b/common/buildcraft/core/inventory/TransactorSimple.java @@ -17,8 +17,8 @@ public class TransactorSimple extends Transactor { int injected = 0; - int slot = 0; - while ((slot = getPartialSlot(stack, orientation, slot)) >= 0 && injected < stack.stackSize) { + int slot = -1; + while ((slot = getPartialSlot(stack, orientation, slot + 1)) >= 0 && injected < stack.stackSize) { injected += addToSlot(slot, stack, injected, doAdd); }