aboutsummaryrefslogtreecommitdiff
path: root/src/item.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/item.cc')
-rw-r--r--src/item.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/item.cc b/src/item.cc
index 3bb9895..5ecdb0c 100644
--- a/src/item.cc
+++ b/src/item.cc
@@ -11,8 +11,12 @@ using namespace std;
namespace entry {
shared_ptr<Item> Item::create(const nlohmann::json& data) {
- if(data["type"] == "weapons") {
- return utils::loadDFromJson<Item, Weapon>(data);
+ if(data["type"] == "weapons" || data["type"] == "spell attack") {
+ auto w = utils::loadDFromJson<Item, Weapon>(data);
+ if(! data["text"].empty()) {
+ w->Entry::setText(data["text"]);
+ }
+ return w;
} else if(data["type"] == "armor") {
return utils::loadDFromJson<Item, Armor>(data);
}