Tests for saving and loading shops

- Fix shop name not being loaded from the file
- Fix skills in shops not storing the skill ID
This commit is contained in:
2015-07-07 22:04:11 -04:00
parent fd42f00e41
commit 93f9860624
5 changed files with 220 additions and 1 deletions

View File

@@ -209,6 +209,7 @@ void cShop::replaceSpecial(size_t i, eShopItemType type, int n) {
items[i].item = store_alchemy(n);
else if(type == eShopItemType::SKILL) {
items[i].item.graphic_num = 108;
items[i].item.item_level = n;
items[i].item.full_name = get_str("skills", n * 2 + 1);
} else if(type == eShopItemType::TREASURE) {
items[i].item.graphic_num = 45;

View File

@@ -554,7 +554,7 @@ static void readShopFromXml(ticpp::Element& data, cShop& shop) {
}
if(!reqs.empty())
throw xMissingElem("special", *reqs.begin(), entry->Row(), entry->Column(), fname);
shop.addSpecial(name, descr, icon, node, cost, amount);
shop.addSpecial(title, descr, icon, node, cost, amount);
} else {
eShopItemType itype;
int n = 0;