mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Remove need for path variable
This commit is contained in:
@@ -5,7 +5,6 @@ local debug = false -- True enables debug printing using DCS messages
|
||||
-- .dll related variables
|
||||
Olympus.OlympusDLL = nil
|
||||
Olympus.DLLsloaded = false
|
||||
Olympus.OlympusModPath = os.getenv('DCSOLYMPUS_PATH')..'\\bin\\'
|
||||
|
||||
-- Logger reference
|
||||
Olympus.log = mist.Logger:new("Olympus", 'info')
|
||||
@@ -31,6 +30,10 @@ Olympus.weapons = {} -- Table holding references to all the currently existing
|
||||
Olympus.missionStartTime = DCS.getRealTime()
|
||||
Olympus.napalmCounter = 1
|
||||
Olympus.fireCounter = 1
|
||||
|
||||
-- Load the current instance folder
|
||||
local lfs = require('lfs')
|
||||
|
||||
------------------------------------------------------------------------------------------------------
|
||||
-- Olympus functions
|
||||
------------------------------------------------------------------------------------------------------
|
||||
@@ -49,7 +52,7 @@ end
|
||||
-- Loads the olympus .dll
|
||||
function Olympus.loadDLLs()
|
||||
-- Add the .dll paths
|
||||
package.cpath = package.cpath..';'..Olympus.OlympusModPath..'?.dll;'
|
||||
package.cpath = package.cpath..';'..Olympus.instancePath..'?.dll;'
|
||||
|
||||
local status
|
||||
status, Olympus.OlympusDLL = pcall(require, 'olympus')
|
||||
@@ -1361,6 +1364,10 @@ end
|
||||
------------------------------------------------------------------------------------------------------
|
||||
-- Olympus startup script
|
||||
------------------------------------------------------------------------------------------------------
|
||||
Olympus.instancePath = lfs.writedir().."Mods\\Services\\Olympus\\bin\\"
|
||||
Olympus.notify("Starting DCS Olympus backend session in "..Olympus.instancePath, 2)
|
||||
|
||||
|
||||
local OlympusName = 'Olympus ' .. version .. ' C++ module';
|
||||
Olympus.DLLsloaded = Olympus.loadDLLs()
|
||||
if Olympus.DLLsloaded then
|
||||
@@ -1402,11 +1409,3 @@ Olympus.initializeUnits()
|
||||
|
||||
Olympus.notify("OlympusCommand script " .. version .. " loaded successfully", 2, true)
|
||||
|
||||
-- Load the current instance folder
|
||||
local lfs = require('lfs')
|
||||
|
||||
Olympus.instancePath = lfs.writedir().."Mods\\Services\\Olympus"
|
||||
|
||||
Olympus.notify("Starting DCS Olympus backend session in "..Olympus.instancePath, 2)
|
||||
Olympus.OlympusDLL.setInstancePath()
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
local version = 'v0.4.11-alpha-rc3'
|
||||
local lfs = require("lfs")
|
||||
|
||||
Olympus = {}
|
||||
Olympus.OlympusDLL = nil
|
||||
Olympus.cppRESTDLL = nil
|
||||
Olympus.DLLsloaded = false
|
||||
Olympus.OlympusModPath = os.getenv('DCSOLYMPUS_PATH')..'\\bin\\'
|
||||
Olympus.OlympusModPath = lfs.writedir().."Mods\\Services\\Olympus\\bin\\"
|
||||
|
||||
log.write('Olympus.HOOKS.LUA', log.INFO,'Executing OlympusHook.lua')
|
||||
|
||||
@@ -14,7 +14,7 @@ function Olympus.loadDLLs()
|
||||
|
||||
local status
|
||||
log.write('Olympus.HOOKS.LUA', log.INFO, 'Loading olympus.dll from ['..Olympus.OlympusModPath..']')
|
||||
status, Olympus.OlympusDLL = pcall(require, 'olympus')
|
||||
status, Olympus.OlympusDLL = require("olympus")
|
||||
if status then
|
||||
log.write('Olympus.HOOKS.LUA', log.INFO, 'olympus.dll loaded successfully')
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user