summaryrefslogtreecommitdiff
path: root/src/textcommand.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-10-10 19:00:20 +0300
committerAndrei Karas <akaras@inbox.ru>2017-10-10 19:31:42 +0300
commit675b9f793e5b36862294e4f0419c5cf2eab72164 (patch)
tree2750b8d336e6f670f4684a55800195f025cb846f /src/textcommand.cpp
parent495110a8cb407548e227b062f6446b8eaa9605d0 (diff)
downloadmanaplus-675b9f793e5b36862294e4f0419c5cf2eab72164.tar.gz
manaplus-675b9f793e5b36862294e4f0419c5cf2eab72164.tar.bz2
manaplus-675b9f793e5b36862294e4f0419c5cf2eab72164.tar.xz
manaplus-675b9f793e5b36862294e4f0419c5cf2eab72164.zip
Fix some asserts in text command editor.
Diffstat (limited to 'src/textcommand.cpp')
-rw-r--r--src/textcommand.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/textcommand.cpp b/src/textcommand.cpp
index 8a5949613..320e295a2 100644
--- a/src/textcommand.cpp
+++ b/src/textcommand.cpp
@@ -125,10 +125,14 @@ void TextCommand::loadImage()
mImage = nullptr;
}
- if (getIcon().empty())
+ if (mIcon.empty() ||
+ !ItemDB::exists(mIcon))
+ {
return;
+ }
- const SpriteDisplay display = ItemDB::get(getIcon()).getDisplay();
+ const ItemInfo &info = ItemDB::get(mIcon);
+ const SpriteDisplay display = info.getDisplay();
mImage = Loader::getImage(pathJoin(paths.getStringValue("itemIcons"),
display.image));