Version 1.6 - important fix for high memory usage

This commit is contained in:
OTCv8
2020-01-01 23:22:56 +01:00
parent d15cc347dc
commit 1d2bdf855d
21 changed files with 83 additions and 322 deletions

View File

@@ -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)