Stack router fix
This commit is contained in:
@@ -44,7 +44,7 @@ public class StackRouter extends DuctRouter{
|
||||
if(unloading && current != null){
|
||||
//unload when possible
|
||||
var target = target();
|
||||
while(target != null && items.total() > 0){
|
||||
while(target != null && items.get(current) > 0){
|
||||
target.handleItem(this, current);
|
||||
items.remove(current, 1);
|
||||
|
||||
@@ -52,13 +52,13 @@ public class StackRouter extends DuctRouter{
|
||||
}
|
||||
|
||||
//if out of items, unloading is over
|
||||
if(items.total() == 0){
|
||||
if(items.get(current) == 0){
|
||||
current = null;
|
||||
unloading = false;
|
||||
}
|
||||
}
|
||||
|
||||
if(current == null && items.total() > 0){
|
||||
if((current == null || items.get(current) == 0) && items.total() > 0){
|
||||
current = items.first();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user