summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-02-23 01:17:15 +0300
committerAndrei Karas <akaras@inbox.ru>2013-02-23 01:28:15 +0300
commitc842a29a63ff5bd7a09aa1c2dfbc96c4a94d4243 (patch)
tree6454b156c010eadaccade729c31da95ee5615609
parent48c0b527f9b20827b06bd7f9abf669faf49487b7 (diff)
downloadplus-c842a29a63ff5bd7a09aa1c2dfbc96c4a94d4243.tar.gz
plus-c842a29a63ff5bd7a09aa1c2dfbc96c4a94d4243.tar.bz2
plus-c842a29a63ff5bd7a09aa1c2dfbc96c4a94d4243.tar.xz
plus-c842a29a63ff5bd7a09aa1c2dfbc96c4a94d4243.zip
Improve dropshortcuts class speed.
-rw-r--r--src/dropshortcut.cpp10
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;