Don't hard-code player max inventory size at all use points
This commit is contained in:
@@ -69,18 +69,18 @@ bool handle_action(sf::Event event) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for(short i = 0; i < 24; i++)
|
||||
for(short i = 0; i < univ.party[current_active_pc].items.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]);
|
||||
univ.party[current_active_pc].take_item(i);
|
||||
}
|
||||
for(short i = 0; i < 24; i++)
|
||||
if((the_point.in(item_string_rects[i][2])) && // identify item
|
||||
univ.party[current_active_pc].items[i].variety != eItemType::NO_ITEM) {
|
||||
flash_rect(item_string_rects[i][2]);
|
||||
univ.party[current_active_pc].items[i].ident = true;
|
||||
}
|
||||
}
|
||||
|
||||
return to_return;
|
||||
}
|
||||
|
@@ -329,7 +329,7 @@ void draw_items() {
|
||||
return; // If PC is dead, it has no items
|
||||
}
|
||||
sf::Texture& invenbtn_gworld = *ResMgr::get<ImageRsrc>("invenbtns");
|
||||
for(short i = 0; i < 24; i++) // Loop through items and draw each
|
||||
for(short i = 0; i < univ.party[current_active_pc].items.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)
|
||||
|
Reference in New Issue
Block a user