v0.9.2: fixed Heap.replace not merging stackable items
This commit is contained in:
@@ -175,6 +175,12 @@ public class Heap implements Bundlable {
|
|||||||
int index = items.indexOf( a );
|
int index = items.indexOf( a );
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
items.remove( index );
|
items.remove( index );
|
||||||
|
for (Item i : items) {
|
||||||
|
if (i.isSimilar( b )) {
|
||||||
|
i.merge( b );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
items.add( index, b );
|
items.add( index, b );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user