diff --git a/modules/game_cooldown/cooldown.lua b/modules/game_cooldown/cooldown.lua index 2d5aaa54..bb5a35fc 100644 --- a/modules/game_cooldown/cooldown.lua +++ b/modules/game_cooldown/cooldown.lua @@ -79,7 +79,7 @@ function onSpellCooldown(iconId, duration) if not spellName then return end local ping = g_game.getPing() - if ping > 0 then local duration = duration - (ping/2) end + if ping > 0 then duration = duration - (ping/2) end local otcIconId = tonumber(SpellInfo[modules.game_spelllist.getSpelllistProfile()][spellName].icon) if not otcIconId and SpellIcons[SpellInfo[modules.game_spelllist.getSpelllistProfile()][spellName].icon] then otcIconId = SpellIcons[SpellInfo[modules.game_spelllist.getSpelllistProfile()][spellName].icon][1] @@ -105,7 +105,7 @@ function onSpellGroupCooldown(groupId, duration) if not SpellGroups[groupId] then return end local ping = g_game.getPing() - if ping > 0 then local duration = duration - (ping/2) end + if ping > 0 then duration = duration - (ping/2) end local icon = contentsPanel:getChildById('groupIcon' .. SpellGroups[groupId]) local progressRect = contentsPanel:getChildById('progressRect' .. SpellGroups[groupId]) if icon then diff --git a/modules/game_interface/gameinterface.lua b/modules/game_interface/gameinterface.lua index 788e939b..801e3a5f 100644 --- a/modules/game_interface/gameinterface.lua +++ b/modules/game_interface/gameinterface.lua @@ -32,7 +32,7 @@ function init() onGameStart = show, onGameEnd = hide, onLoginAdvice = onLoginAdvice, - onWalk = onWalk, + onWalk = onWalk }, true) connect(LocalPlayer, { diff --git a/modules/game_interface/widgets/uigamemap.lua b/modules/game_interface/widgets/uigamemap.lua index 8072ff61..3557f75a 100644 --- a/modules/game_interface/widgets/uigamemap.lua +++ b/modules/game_interface/widgets/uigamemap.lua @@ -86,6 +86,7 @@ function UIGameMap:onMouseRelease(mousePosition, mouseButton) local ret = modules.game_interface.processMouseAction(mousePosition, mouseButton, autoWalkPos, lookThing, useThing, creatureThing, multiUseThing) if ret then + modules.game_interface.cancelAutoWalkCheck() self.cancelNextRelease = true end diff --git a/modules/game_interface/widgets/uiitem.lua b/modules/game_interface/widgets/uiitem.lua index af067ed6..b6fb4c8b 100644 --- a/modules/game_interface/widgets/uiitem.lua +++ b/modules/game_interface/widgets/uiitem.lua @@ -87,6 +87,7 @@ function UIItem:onMouseRelease(mousePosition, mouseButton) self.cancelNextRelease = true return true elseif modules.game_interface.processMouseAction(mousePosition, mouseButton, nil, item, item, nil, item) then + modules.game_interface.cancelAutoWalkCheck() return true end return false diff --git a/modules/game_viplist/viplist.lua b/modules/game_viplist/viplist.lua index 911180f6..eea3d18a 100644 --- a/modules/game_viplist/viplist.lua +++ b/modules/game_viplist/viplist.lua @@ -97,13 +97,14 @@ function onAddVip(id, name, state) for i=1,childrenCount do local child = vipList:getChildByIndex(i) - if state == VipState.Online and not child.vipState == VipState.Online then + if state == VipState.Online and child.vipState ~= VipState.Online then vipList:insertChild(i, label) return end - if (not state == VipState.Online and not child.vipState == VipState.Online) + if (state ~= VipState.Online and child.vipState ~= VipState.Online) or (state == VipState.Online and child.vipState == VipState.Online) then + local childText = child:getText():lower() local length = math.min(childText:len(), nameLower:len()) @@ -113,6 +114,8 @@ function onAddVip(id, name, state) return elseif nameLower:byte(j) > childText:byte(j) then break + elseif j == nameLower:len() then -- We are at the end of nameLower, and its shorter than childText, thus insert before + vipList:insertChild(i, label) end end end diff --git a/src/otclient/creature.cpp b/src/otclient/creature.cpp index f82d821a..a695749e 100644 --- a/src/otclient/creature.cpp +++ b/src/otclient/creature.cpp @@ -672,6 +672,9 @@ Point Creature::getDrawOffset() int Creature::getStepDuration(bool ignoreDiagonal) { int speed = m_speed; + if(speed < 1) + return 0; + if(g_game.getFeature(Otc::GameNewSpeedLaw)) speed *= 2;