Prevent running crossfire.lua if crossfire not available

Checks if crossfire is available before running crossfire.lua. Exits the script and shows an error message if not.
This commit is contained in:
Hans Christian Olaussen
2020-12-15 22:43:37 +01:00
parent 75cfbad753
commit 94e50f146a
3 changed files with 15 additions and 0 deletions
@@ -30,6 +30,11 @@ local function run(event)
return 2
end
if crossfireTelemetryPush() == nil then
error("Crossfire not available!")
return 2
end
chdir("/SCRIPTS/TOOLS/CROSSFIRE")
return "crossfire.lua"
end
@@ -30,6 +30,11 @@ local function run(event)
return 2
end
if crossfireTelemetryPush() == nil then
error("Crossfire not available!")
return 2
end
chdir("/SCRIPTS/TOOLS/CROSSFIRE")
return "crossfire.lua"
end
@@ -30,6 +30,11 @@ local function run(event)
return 2
end
if crossfireTelemetryPush() == nil then
error("Crossfire not available!")
return 2
end
chdir("/SCRIPTS/TOOLS/CROSSFIRE")
return "crossfire.lua"
end