Remove the 30-item limit in shops

This commit is contained in:
2019-12-02 01:16:34 -05:00
parent fd8bd913cc
commit 6f96222c37
10 changed files with 88 additions and 86 deletions

View File

@@ -96,7 +96,7 @@ extern rectangle shop_frame ;
extern rectangle shop_done_rect;
extern char *heal_types[];
extern short heal_costs[8];
extern short shop_array[30];
extern std::vector<int> shop_array;
// Missile anim vars
struct store_missile_type {
@@ -726,8 +726,8 @@ void draw_shop_graphics(bool pressed,rectangle clip_area_rect) {
// Place all the items
for(short i = 0; i < 8; i++) {
current_pos = i + shop_sbar->getPosition();
if(shop_array[current_pos] < 0)
break; // theoretically, this shouldn't happen
if(current_pos >= shop_array.size() || shop_array[current_pos] < 0)
break; // theoretically, the second condition shouldn't happen
cShopItem item = active_shop.getItem(shop_array[current_pos]);
eSpell spell;
cur_cost = item.getCost(active_shop.getCostAdjust());