mirror of
https://github.com/edubart/otclient.git
synced 2025-10-16 12:34:55 +02:00
Improvement / Fix hotkeys
- Hotkeys now check items in inventory - Fixed USEONETARGET hotkey bug
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user