diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-24 23:29:04 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-24 23:29:04 +0300 |
commit | 4e97da8e138b21a5f5bea75e6a8d3211e4f28594 (patch) | |
tree | c10d3cad963066a908ebd42041723e110a0c9bf0 /src/net/eathena/npchandler.cpp | |
parent | ca0ca278d0c4aed9a6d50bb9a8982f5261151ab8 (diff) | |
download | plus-4e97da8e138b21a5f5bea75e6a8d3211e4f28594.tar.gz plus-4e97da8e138b21a5f5bea75e6a8d3211e4f28594.tar.bz2 plus-4e97da8e138b21a5f5bea75e6a8d3211e4f28594.tar.xz plus-4e97da8e138b21a5f5bea75e6a8d3211e4f28594.zip |
Add enum for item types.
Diffstat (limited to 'src/net/eathena/npchandler.cpp')
-rw-r--r-- | src/net/eathena/npchandler.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp index 7d0a65abc..2e5175253 100644 --- a/src/net/eathena/npchandler.cpp +++ b/src/net/eathena/npchandler.cpp @@ -142,13 +142,20 @@ void NpcHandler::buyItems(std::vector<ShopItem*> &items) const { ShopItem *const item = *it; const int usedQuantity = item->getUsedQuantity(); - const int type = item->getType(); + const ItemTypeT type = item->getType(); if (!usedQuantity) continue; - if (type == 4 || type == 5 || type == 7 || type == 8) + if (type == ItemType::Weapon || + type == ItemType::Armor || + type == ItemType::PetEgg || + type == ItemType::PetArmor) + { cnt += item->getUsedQuantity(); + } else + { cnt ++; + } } if (cnt > 100) @@ -164,8 +171,11 @@ void NpcHandler::buyItems(std::vector<ShopItem*> &items) const continue; item->increaseUsedQuantity(-usedQuantity); item->update(); - const int type = item->getType(); - if (type == 4 || type == 5 || type == 7 || type == 8) + const ItemTypeT type = item->getType(); + if (type == ItemType::Weapon || + type == ItemType::Armor || + type == ItemType::PetEgg || + type == ItemType::PetArmor) { for (int f = 0; f < usedQuantity; f ++) { |