summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusalva Jesusalva <jesusalva@themanaworld.org>2022-11-20 18:41:05 +0000
committerJesusalva Jesusalva <jesusalva@themanaworld.org>2022-11-20 18:41:05 +0000
commita01f9d8865fb62e993864257ba28dfab21435ae7 (patch)
tree53f209fa2c756c86330cb3bce061032fbfc80aaf
parentfb0f48bac0a17d5349dac63687eed724c440cbe9 (diff)
downloadmanamarket-a01f9d8865fb62e993864257ba28dfab21435ae7.tar.gz
manamarket-a01f9d8865fb62e993864257ba28dfab21435ae7.tar.bz2
manamarket-a01f9d8865fb62e993864257ba28dfab21435ae7.tar.xz
manamarket-a01f9d8865fb62e993864257ba28dfab21435ae7.zip
Fix ManaMarket "bug"
-rw-r--r--utils.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/utils.py b/utils.py
index aad402f..692b72a 100644
--- a/utils.py
+++ b/utils.py
@@ -53,7 +53,18 @@ class ItemDB:
self.itemdb_file = ElementTree(file="data/items.xml")
for item in self.itemdb_file.getroot():
- if item.get('name'):
+ ## Item declaration
+ if item.get('id'):
+ item3 = item
+ item_struct = Item()
+ item_struct.name = item3.get('name')
+ item_struct.weight = int(item3.get('weight', 0))
+ if item3.get('type'):
+ item_struct.type = item3.get('type')
+ item_struct.description = item3.get('description')
+ self.item_names[int(item3.get('id'))] = item_struct
+ ## Import statement
+ elif item.get('name'):
file2 = ElementTree(file=item.get('name'))
for item2 in file2.getroot():
if item2.get('name'):