From db50e5f3c0d7a0ce5d3ae99af9d874cbe2e5caeb Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Sun, 1 Feb 2015 00:34:52 +0300
Subject: Fix use menu item translation for unusable items.

---
 src/resources/db/itemdb.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'src')

diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp
index da8072980..1b4296ad6 100644
--- a/src/resources/db/itemdb.cpp
+++ b/src/resources/db/itemdb.cpp
@@ -147,7 +147,11 @@ static std::string useButtonFromItemType(const ItemType::Type &type)
     {
         const ItemTypeMap &item = itemTypeMap[f];
         if (item.type == type)
+        {
+            if (item.useButton.empty())
+                return std::string();
             return gettext(item.useButton.c_str());
+        }
     }
     logger->log("Unknown item type");
     return std::string();
@@ -160,7 +164,11 @@ static std::string useButton2FromItemType(const ItemType::Type &type)
     {
         const ItemTypeMap &item = itemTypeMap[f];
         if (item.type == type)
+        {
+            if (item.useButton2.empty())
+                return std::string();
             return gettext(item.useButton2.c_str());
+        }
     }
     logger->log("Unknown item type");
     return std::string();
-- 
cgit v1.2.3-70-g09d2