mirror of
https://github.com/ciribob/DCS-CTLD.git
synced 2026-08-28 23:46:43 +00:00
Stability Fix
Possible fix for intermittent crashes
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
|
||||
See https://github.com/ciribob/DCS-CTLD for a user manual and the latest version
|
||||
|
||||
Version: 1.20 - 21/06/2015 - Crates in Zone now works for Spawned crates and Ones added by the mission editor
|
||||
Version: 1.21 - 21/06/2015 - Crates in Zone now works for Spawned crates and Ones added by the mission editor
|
||||
- Enabled multi crate units
|
||||
- Added new parameter for the number of launchers to spawn a HAWK with
|
||||
|
||||
@@ -704,7 +704,10 @@ end
|
||||
--
|
||||
--end
|
||||
|
||||
function ctld.spawnCrate(_args)
|
||||
function ctld.spawnCrate(_arguments)
|
||||
|
||||
local _status,_err = pcall(
|
||||
function(_args)
|
||||
|
||||
-- use the cargo weight to guess the type of unit as no way to add description :(
|
||||
|
||||
@@ -779,6 +782,13 @@ function ctld.spawnCrate(_args)
|
||||
else
|
||||
env.info("Couldn't find crate item to spawn")
|
||||
end
|
||||
|
||||
end
|
||||
, _arguments)
|
||||
|
||||
if (not _status) then
|
||||
env.error(string.format("CTLD ERROR: %s", _err))
|
||||
end
|
||||
end
|
||||
|
||||
function ctld.troopsOnboard(_heli, _troops)
|
||||
@@ -1633,7 +1643,10 @@ end
|
||||
|
||||
|
||||
|
||||
function ctld.unpackCrates(_args)
|
||||
function ctld.unpackCrates(_arguments)
|
||||
|
||||
local _status,_err = pcall(
|
||||
function(_args)
|
||||
|
||||
-- trigger.action.outText("Unpack Crates".._args[1],10)
|
||||
|
||||
@@ -1673,7 +1686,7 @@ function ctld.unpackCrates(_args)
|
||||
-- ctld.spawnCrateStatic( _heli:getCoalition(),mist.getNextUnitId(),{x=100,z=100},_crateName,100)
|
||||
|
||||
--remove crate
|
||||
_crate.crateUnit:destroy()
|
||||
-- _crate.crateUnit:destroy()
|
||||
|
||||
local _spawnedGroups = ctld.spawnCrateGroup(_heli, { _cratePoint }, { _crate.details.unit })
|
||||
|
||||
@@ -1700,6 +1713,11 @@ function ctld.unpackCrates(_args)
|
||||
ctld.displayMessageToGroup(_heli, "No friendly crates close enough to unpack", 20)
|
||||
end
|
||||
end
|
||||
end, _arguments)
|
||||
|
||||
if (not _status) then
|
||||
env.error(string.format("CTLD ERROR: %s", _err))
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -2383,7 +2401,7 @@ function ctld.unpackHawk(_heli, _nearestCrate, _nearbyCrates)
|
||||
end
|
||||
|
||||
--destroy
|
||||
_hawkPart.crateUnit:destroy()
|
||||
-- _hawkPart.crateUnit:destroy()
|
||||
end
|
||||
|
||||
-- HAWK READY!
|
||||
@@ -2440,7 +2458,7 @@ function ctld.unpackMultiCrate(_heli, _nearestCrate, _nearbyCrates)
|
||||
end
|
||||
|
||||
--destroy
|
||||
_crate.crateUnit:destroy()
|
||||
-- _crate.crateUnit:destroy()
|
||||
end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user