Allow PC to accept item that will stack, even if slots full

This commit is contained in:
2025-03-19 17:50:24 -05:00
parent cb73d5d7f6
commit 599f1030f2
7 changed files with 62 additions and 38 deletions

View File

@@ -67,7 +67,7 @@ bool handle_action(const sf::Event & event) {
break;
}
}
for(short i = 0; i < univ.party[current_active_pc].items.size(); i++) {
for(short i = 0; i < cPlayer::INVENTORY_SIZE; i++) {
if((the_point.in(item_string_rects[i][1])) && // drop item
univ.party[current_active_pc].items[i].variety != eItemType::NO_ITEM) {
flash_rect(item_string_rects[i][1]);

View File

@@ -344,7 +344,7 @@ void draw_items() {
return; // If PC is dead, it has no items
}
sf::Texture& invenbtn_gworld = *ResMgr::graphics.get("invenbtns");
for(short i = 0; i < univ.party[current_active_pc].items.size(); i++) // Loop through items and draw each
for(short i = 0; i < cPlayer::INVENTORY_SIZE; i++) // Loop through items and draw each
if(univ.party[current_active_pc].items[i].variety != eItemType::NO_ITEM) { // i.e. does item exist
std::string to_draw = std::to_string(i + 1) + ". ";
if(!univ.party[current_active_pc].items[i].ident)