diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-02-23 01:17:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-02-23 01:28:15 +0300 |
commit | c842a29a63ff5bd7a09aa1c2dfbc96c4a94d4243 (patch) | |
tree | 6454b156c010eadaccade729c31da95ee5615609 /src | |
parent | 48c0b527f9b20827b06bd7f9abf669faf49487b7 (diff) | |
download | plus-c842a29a63ff5bd7a09aa1c2dfbc96c4a94d4243.tar.gz plus-c842a29a63ff5bd7a09aa1c2dfbc96c4a94d4243.tar.bz2 plus-c842a29a63ff5bd7a09aa1c2dfbc96c4a94d4243.tar.xz plus-c842a29a63ff5bd7a09aa1c2dfbc96c4a94d4243.zip |
Improve dropshortcuts class speed.
Diffstat (limited to 'src')
-rw-r--r-- | src/dropshortcut.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/dropshortcut.cpp b/src/dropshortcut.cpp index b77d42624..d0e49ab5f 100644 --- a/src/dropshortcut.cpp +++ b/src/dropshortcut.cpp @@ -110,14 +110,14 @@ void DropShortcut::dropFirst() const ->findItem(itemId, itemColor); if (item && item->getQuantity()) { + const int cnt = player_node->getQuickDropCounter(); if (player_node->isServerBuggy()) { - Net::getInventoryHandler()->dropItem(item, - player_node->getQuickDropCounter()); + Net::getInventoryHandler()->dropItem(item, cnt); } else { - for (int i = 0; i < player_node->getQuickDropCounter(); i++) + for (int i = 0; i < cnt; i++) Net::getInventoryHandler()->dropItem(item, 1); } } @@ -129,7 +129,6 @@ void DropShortcut::dropItems(const int cnt) if (!player_node) return; - if (player_node->isServerBuggy()) { dropItem(player_node->getQuickDropCounter()); @@ -137,9 +136,10 @@ void DropShortcut::dropItems(const int cnt) } int n = 0; + const int sz = player_node->getQuickDropCounter(); for (int f = 0; f < 9; f++) { - for (int i = 0; i < player_node->getQuickDropCounter(); i++) + for (int i = 0; i < sz; i++) { if (!Client::limitPackets(PACKET_DROP)) return; |