v2.0.0: fixed wndbag showing 18 slots instead of 19 with a second wep

This commit is contained in:
Evan Debenham
2023-01-29 15:04:19 -05:00
parent 9ca04b261c
commit 908bfe61b2

View File

@@ -252,6 +252,8 @@ public class WndBag extends WndTabbed {
placeItem( stuff.misc != null ? stuff.misc : new Placeholder( ItemSpriteSheet.SOMETHING ) );
placeItem( stuff.ring != null ? stuff.ring : new Placeholder( ItemSpriteSheet.RING_HOLDER ) );
int equipped = 5;
//the container itself if it's not the root backpack
if (container != Dungeon.hero.belongings.backpack){
placeItem(container);
@@ -259,6 +261,7 @@ public class WndBag extends WndTabbed {
} else if (stuff.secondWep != null) {
//second weapon always goes to the front of view on main bag
placeItem(stuff.secondWep);
equipped++;
}
// Items in the bag, except other containers (they have tags at the bottom)
@@ -271,7 +274,7 @@ public class WndBag extends WndTabbed {
}
// Free Space
while ((count - 5) < container.capacity()) {
while ((count - equipped) < container.capacity()) {
placeItem( null );
}
}