diff options
author | Andrei Karas <akaras@inbox.ru> | 2020-02-23 09:30:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2020-02-23 09:30:51 +0300 |
commit | 1e2a88e975019929c4c7e3154537865cc09550a6 (patch) | |
tree | ae8bc68ad3a3f6b61a5e2d511d7fc17daa22bd0e /src/gui/shortcut | |
parent | 6941fd4eeb1dce20aba8c42fd030c2690c37b731 (diff) | |
download | manaverse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.gz manaverse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.bz2 manaverse-1e2a88e975019929c4c7e3154537865cc09550a6.tar.xz manaverse-1e2a88e975019929c4c7e3154537865cc09550a6.zip |
Fix some code style issues
Diffstat (limited to 'src/gui/shortcut')
-rw-r--r-- | src/gui/shortcut/itemshortcut.cpp | 2 | ||||
-rw-r--r-- | src/gui/shortcut/shortcutbase.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/shortcut/itemshortcut.cpp b/src/gui/shortcut/itemshortcut.cpp index 51c1532bb..60d6ef72d 100644 --- a/src/gui/shortcut/itemshortcut.cpp +++ b/src/gui/shortcut/itemshortcut.cpp @@ -120,9 +120,9 @@ void ItemShortcut::save() const for (unsigned int i = 0; i < SHORTCUT_ITEMS; i++) { const int itemId = mItems[i] != 0 ? mItems[i] : -1; - const int itemColor = toInt(mItemColors[i], int); if (itemId != -1) { + const int itemColor = toInt(mItemColors[i], int); const std::string itemData = mItemData[i]; serverConfig.setValue(name + toString(i), itemId); serverConfig.setValue(color + toString(i), itemColor); diff --git a/src/gui/shortcut/shortcutbase.cpp b/src/gui/shortcut/shortcutbase.cpp index e6e1a5923..3fe0250fa 100644 --- a/src/gui/shortcut/shortcutbase.cpp +++ b/src/gui/shortcut/shortcutbase.cpp @@ -76,11 +76,11 @@ void ShortcutBase::save() const for (size_t i = 0; i < mMaxSize; i++) { const int itemId = mItems[i] != 0 ? mItems[i] : -1; - const int itemColor = (mItemColors[i] != ItemColor_zero) - ? toInt(mItemColors[i], int) : 1; const std::string num = toString(CAST_S32(i)); if (itemId != -1) { + const int itemColor = (mItemColors[i] != ItemColor_zero) + ? toInt(mItemColors[i], int) : 1; serverConfig.setValue(mItemName + num, itemId); serverConfig.setValue(mColorName + num, itemColor); } |