Improvement / Fix hotkeys

- Hotkeys now check items in inventory
- Fixed USEONETARGET hotkey bug
This commit is contained in:
Sam
2013-10-05 02:31:44 +02:00
parent 5843b78e87
commit e6977b1b43
2 changed files with 19 additions and 4 deletions

View File

@@ -4,6 +4,20 @@ function g_game.getRsa()
return currentRsa
end
function g_game.findPlayerItem(itemId, subType)
local localPlayer = g_game.getLocalPlayer()
if localPlayer then
for slot = InventorySlotFirst, InventorySlotLast do
local item = localPlayer:getInventoryItem(slot)
if item and item:getId() == itemId and (subType == -1 or item:getSubType() == subType) then
return item
end
end
end
return g_game.findItemInContainers(itemId, subType)
end
function g_game.chooseRsa(host)
if currentRsa ~= CIPSOFT_RSA and currentRsa ~= OTSERV_RSA then return end
if host:ends('.tibia.com') or host:ends('.cipsoft.com') then