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