Remove the 30-item limit in shops
This commit is contained in:
@@ -37,9 +37,6 @@ cParty::cParty(long party_preset) {
|
||||
in_boat = -1;
|
||||
in_horse = -1;
|
||||
std::fill(magic_ptrs.begin(), magic_ptrs.end(), 0);
|
||||
for(int i = 0; i < 5; i++)
|
||||
for(int j = 0; j < 10; j++)
|
||||
magic_store_items[i][j].variety = eItemType::NO_ITEM;
|
||||
for(int i = 0; i < 10; i++)
|
||||
out_c[i].exists = false;
|
||||
for(int i = 0; i < 6; i++)
|
||||
@@ -773,10 +770,10 @@ void cParty::writeTo(std::ostream& file, const cScenario& scen) const {
|
||||
}
|
||||
file << '\f';
|
||||
for(auto& p : magic_store_items) {
|
||||
for(int j = 0; j < p.second.size(); j++)
|
||||
if(p.second[j].variety != eItemType::NO_ITEM){
|
||||
file << "MAGICSTORE " << p.first << ' ' << j << '\n';
|
||||
p.second[j].writeTo(file);
|
||||
for(auto& p2 : p.second)
|
||||
if(p2.second.variety != eItemType::NO_ITEM){
|
||||
file << "MAGICSTORE " << p.first << ' ' << p2.first << '\n';
|
||||
p2.second.writeTo(file);
|
||||
file << '\f';
|
||||
}
|
||||
}
|
||||
@@ -1030,7 +1027,6 @@ void cParty::readFrom(std::istream& file, cScenario& scen){
|
||||
} else if(cur == "MAGICSTORE") {
|
||||
int i,j;
|
||||
bin >> i >> j;
|
||||
if(j < 0 || j >= 30) continue;
|
||||
magic_store_items[i][j].readFrom(bin);
|
||||
} else if(cur == "ENCOUNTER") {
|
||||
int i;
|
||||
|
@@ -101,7 +101,7 @@ public:
|
||||
short in_boat;
|
||||
short in_horse;
|
||||
std::array<cOutdoors::cCreature,10> out_c;
|
||||
std::map<int,std::array<cItem,30>> magic_store_items;
|
||||
std::map<int,std::map<int,cItem>> magic_store_items;
|
||||
std::map<int,std::map<int,int>> store_limited_stock;
|
||||
std::vector<job_bank_t> job_banks;
|
||||
std::array<mon_num_t,4> imprisoned_monst; // Soul Crystal
|
||||
|
@@ -1348,9 +1348,7 @@ void cUniverse::enter_scenario(const std::string& name) {
|
||||
pop.which_town = 200;
|
||||
for(short i = 0; i < 10; i++)
|
||||
party.out_c[i].exists = false;
|
||||
for(short i = 0; i < 5; i++)
|
||||
for(short j = 0; j < 10; j++)
|
||||
party.magic_store_items[i][j].variety = eItemType::NO_ITEM;
|
||||
party.magic_store_items.clear();
|
||||
// TODO: Now uncertain if the journal should really persist
|
||||
// univ.party.journal.clear();
|
||||
party.special_notes.clear();
|
||||
@@ -1419,7 +1417,7 @@ void cUniverse::refresh_store_items() {
|
||||
for(size_t i = 0; i < scenario.shops.size(); i++) {
|
||||
if(scenario.shops[i].getType() != eShopType::RANDOM)
|
||||
continue;
|
||||
for(int j = 0; j < 30; j++) {
|
||||
for(int j = 0; j < scenario.shops[i].size(); j++) {
|
||||
cShopItem entry = scenario.shops[i].getItem(j);
|
||||
if(entry.type == eShopItemType::TREASURE) {
|
||||
party.magic_store_items[i][j] = get_random_store_item(entry.item.item_level, entry.item.item_level == 0);
|
||||
@@ -1444,7 +1442,6 @@ void cUniverse::refresh_store_items() {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
party.magic_store_items[i][j] = cItem();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user