Gather all enchantment info into a single place

This also resolves several TODO notes about duplicate code and makes cPresetItem::ability an eEnchant
This commit is contained in:
2024-08-28 23:41:36 -04:00
committed by Celtic Minstrel
parent 71a9d11cd0
commit 6965b822dc
22 changed files with 216 additions and 83 deletions

View File

@@ -767,7 +767,7 @@ void writeTownToXml(ticpp::Printer&& data, cTown& town) {
data.PushElement("type", town.preset_items[i].code);
if(town.preset_items[i].charges > 0)
data.PushElement("charges", town.preset_items[i].charges);
if(town.preset_items[i].ability >= 0)
if(town.preset_items[i].ability != eEnchant::NONE)
data.PushElement("mod", town.preset_items[i].ability);
if(town.preset_items[i].always_there)
data.PushElement("always", true);