mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-20 14:43:27 +02:00
Version 1.6 - important fix for high memory usage
This commit is contained in:
@@ -7,6 +7,7 @@ lastFinishedStep = 0
|
||||
autoWalkEvent = nil
|
||||
firstStep = true
|
||||
walkLock = 0
|
||||
walkEvent = nil
|
||||
lastWalk = 0
|
||||
lastTurn = 0
|
||||
lastTurnDirection = 0
|
||||
@@ -202,7 +203,7 @@ function changeWalkDir(dir, pop)
|
||||
end
|
||||
|
||||
function smartWalk(dir)
|
||||
scheduleEvent(function()
|
||||
walkEvent = scheduleEvent(function()
|
||||
if g_keyboard.getModifiers() == KeyboardNoModifier then
|
||||
local direction = smartWalkDir or dir
|
||||
walk(direction)
|
||||
@@ -371,6 +372,8 @@ function turn(dir, repeated)
|
||||
return
|
||||
end
|
||||
|
||||
removeEvent(walkEvent)
|
||||
|
||||
if not repeated or (lastTurn + 100 < g_clock.millis()) then
|
||||
g_game.turn(dir)
|
||||
changeWalkDir(dir)
|
||||
|
Reference in New Issue
Block a user