diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-08-15 13:58:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-08-16 01:52:14 +0300 |
commit | 41cc92f73e39cec5dfea6b1164176610cccc7df4 (patch) | |
tree | 22fd3d388084d2c61fe80f0441c3c30ab8ffd33c /src/actions | |
parent | 7aa637abc8b0bca35aacdb9492e65f557ed32038 (diff) | |
download | manaplus-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.gz manaplus-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.bz2 manaplus-41cc92f73e39cec5dfea6b1164176610cccc7df4.tar.xz manaplus-41cc92f73e39cec5dfea6b1164176610cccc7df4.zip |
Add strong typed int for item color.
Diffstat (limited to 'src/actions')
-rw-r--r-- | src/actions/actions.cpp | 17 | ||||
-rw-r--r-- | src/actions/commands.cpp | 2 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 92c0029ed..014ae10f8 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -439,7 +439,8 @@ impHandler(dropItemId) return false; // +++ ignoring item color for now - Item *const item = inv->findItem(atoi(event.args.c_str()), 1); + Item *const item = inv->findItem(atoi(event.args.c_str()), + ItemColor_one); if (item && !PlayerInfo::isItemProtected(item->getId())) { @@ -467,7 +468,8 @@ impHandler(dropItemIdAll) return false; // +++ ignoring item color for now - Item *const item = inv->findItem(atoi(event.args.c_str()), 1); + Item *const item = inv->findItem(atoi(event.args.c_str()), + ItemColor_one); if (item && !PlayerInfo::isItemProtected(item->getId())) PlayerInfo::dropItem(item, item->getQuantity(), Sfx_true); @@ -1485,14 +1487,14 @@ impHandler0(createItems) if (!colors) { - dialog->addItem(id, 0, 1, 100, 0); + dialog->addItem(id, 0, ItemColor_one, 100, 0); } else { - for (unsigned char f = 0; f < colors; f ++) + for (int f = 0; f < colors; f ++) { - if (!info->getColor(f).empty()) - dialog->addItem(id, 0, f, 100, 0); + if (!info->getColor(fromInt(f, ItemColor)).empty()) + dialog->addItem(id, 0, fromInt(f, ItemColor), 100, 0); } } } @@ -1548,7 +1550,8 @@ impHandler(useItem) if (inv) { // +++ ignoring item color for now - const Item *const item = inv->findItem(itemId, 1); + const Item *const item = inv->findItem(itemId, + ItemColor_one); PlayerInfo::useEquipItem(item, Sfx_true); } } diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 8070efcc7..0a8ef91ba 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -285,7 +285,7 @@ impHandler(chatAdd) if (inv) { // +++ need add also color here - item = inv->findItem(id, 1); + item = inv->findItem(id, ItemColor_one); } if (item) |