From c842a29a63ff5bd7a09aa1c2dfbc96c4a94d4243 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 23 Feb 2013 01:17:15 +0300 Subject: Improve dropshortcuts class speed. --- src/dropshortcut.cpp | 10 +++++----- 1 file 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; -- cgit v1.2.3-70-g09d2