1
0
mirror of https://github.com/LDDestroier/CC/ synced 2024-11-17 15:24:52 +00:00

Fixed crash in CraftOS-PC

CraftOS-PC crashes if you attempt to cancel a timer or alarm that isn't running. Although, this is really a bug with COS-PC and not with Workspace...
This commit is contained in:
LDDestroier 2021-05-17 19:24:21 -04:00 committed by GitHub
parent 8f23fa9a3a
commit ca865a5e9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1348,7 +1348,7 @@ local main = function()
instances[focus[2]][focus[1]].paused = not instances[focus[2]][focus[1]].paused
enteringCommand = true
doDrawWorkspaceIndicator = instances[focus[2]][focus[1]].paused and 2 or 3
os.cancelTimer(wID)
wID = os.startTimer(workspaceIndicatorDuration)
if config.doPauseClockAndTime then
if instances[focus[2]][focus[1]].paused then
@ -1377,7 +1377,7 @@ local main = function()
end
end
doDrawWorkspaceIndicator = 1
os.cancelTimer(wID)
wID = os.startTimer(workspaceIndicatorDuration)
correctPalette(focus[1], focus[2])
enteringCommand = true
@ -1395,7 +1395,7 @@ local main = function()
end
end
doDrawWorkspaceIndicator = 1
os.cancelTimer(wID)
wID = os.startTimer(workspaceIndicatorDuration)
correctPalette(focus[1], focus[2])
enteringCommand = true
@ -1415,7 +1415,7 @@ local main = function()
end
end
doDrawWorkspaceIndicator = 1
os.cancelTimer(wID)
wID = os.startTimer(workspaceIndicatorDuration)
correctPalette(focus[1], focus[2])
enteringCommand = true
@ -1435,7 +1435,7 @@ local main = function()
end
end
doDrawWorkspaceIndicator = 1
os.cancelTimer(wID)
wID = os.startTimer(workspaceIndicatorDuration)
correctPalette(focus[1], focus[2])
enteringCommand = true
@ -1443,7 +1443,7 @@ local main = function()
if keysDown[keys.w] then
addWorkspace(0, -1)
doDrawWorkspaceIndicator = 1
os.cancelTimer(wID)
wID = os.startTimer(workspaceIndicatorDuration)
keysDown[keys.w] = false
gridWidth, gridHeight, gridMinX, gridMinY = getMapSize()
@ -1451,7 +1451,7 @@ local main = function()
if keysDown[keys.s] then
addWorkspace(0, 1)
doDrawWorkspaceIndicator = 1
os.cancelTimer(wID)
wID = os.startTimer(workspaceIndicatorDuration)
keysDown[keys.s] = false
gridWidth, gridHeight, gridMinX, gridMinY = getMapSize()
@ -1459,7 +1459,7 @@ local main = function()
if keysDown[keys.a] then
addWorkspace(-1, 0)
doDrawWorkspaceIndicator = 1
os.cancelTimer(wID)
wID = os.startTimer(workspaceIndicatorDuration)
keysDown[keys.a] = false
gridWidth, gridHeight, gridMinX, gridMinY = getMapSize()
@ -1467,14 +1467,14 @@ local main = function()
if keysDown[keys.d] then
addWorkspace(1, 0)
doDrawWorkspaceIndicator = 1
os.cancelTimer(wID)
wID = os.startTimer(workspaceIndicatorDuration)
keysDown[keys.d] = false
gridWidth, gridHeight, gridMinX, gridMinY = getMapSize()
end
if keysDown[keys.q] then
doDrawWorkspaceIndicator = 1
os.cancelTimer(wID)
wID = os.startTimer(workspaceIndicatorDuration)
keysDown[keys.q] = false
local good = false