From 01293baa64fa905c5763020bd6c0b4903d41fc78 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 12 Jun 2021 15:32:53 -0400 Subject: Verified some creature attacks --- src/item.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/item.cc') 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::create(const nlohmann::json& data) { - if(data["type"] == "weapons") { - return utils::loadDFromJson(data); + if(data["type"] == "weapons" || data["type"] == "spell attack") { + auto w = utils::loadDFromJson(data); + if(! data["text"].empty()) { + w->Entry::setText(data["text"]); + } + return w; } else if(data["type"] == "armor") { return utils::loadDFromJson(data); } -- cgit v1.2.3