From 8cdab5c814403d875e05fb44876de5244ca928b9 Mon Sep 17 00:00:00 2001 From: BeniS Date: Mon, 31 Dec 2012 00:32:09 +1300 Subject: [PATCH] Tested and fixed #155 * Also fixed a typo in the game_tibiafiles module. --- modules/game_tibiafiles/tibiafiles.lua | 2 +- src/otclient/game.cpp | 2 +- src/otclient/item.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/game_tibiafiles/tibiafiles.lua b/modules/game_tibiafiles/tibiafiles.lua index f5bfbbb0..36640729 100644 --- a/modules/game_tibiafiles/tibiafiles.lua +++ b/modules/game_tibiafiles/tibiafiles.lua @@ -37,7 +37,7 @@ function load() addEvent(function() messageBox:raise() messageBox:focus() end) disconnect(g_game, { onProtocolVersionChange = load }) - g_game.setprotocolVersion(0) + g_game.setProtocolVersion(0) connect(g_game, { onProtocolVersionChange = load }) end end diff --git a/src/otclient/game.cpp b/src/otclient/game.cpp index 2acd29ea..4597b4bd 100644 --- a/src/otclient/game.cpp +++ b/src/otclient/game.cpp @@ -1054,7 +1054,7 @@ void Game::buyItem(const ItemPtr& item, int amount, bool ignoreCapacity, bool bu { if(!canPerformGameAction() || !item) return; - m_protocolGame->sendBuyItem(item->getId(), item->getSubType(), amount, ignoreCapacity, buyWithBackpack); + m_protocolGame->sendBuyItem(item->getId(), item->getCountOrSubType(), amount, ignoreCapacity, buyWithBackpack); } void Game::sellItem(const ItemPtr& item, int amount, bool ignoreEquipped) diff --git a/src/otclient/item.cpp b/src/otclient/item.cpp index dcb42744..7f2bd685 100644 --- a/src/otclient/item.cpp +++ b/src/otclient/item.cpp @@ -216,9 +216,9 @@ int Item::getSubType() { if(isSplash() || isFluidContainer()) return m_countOrSubType; - if(m_countOrSubType > 0 && g_game.getProtocolVersion() >= 870) - return 1; - return 0; + if(g_game.getProtocolVersion() >= 900) + return 0; + return 1; } int Item::getCount()