mirror of
https://github.com/ciribob/DCS-CTLD.git
synced 2025-08-15 06:17:22 +00:00
commit
This commit is contained in:
10
CTLD.lua
10
CTLD.lua
@@ -2060,19 +2060,19 @@ function ctld.repackVehicle(_params, t) -- scan rrs table 'repackRequestsStack'
|
|||||||
local playerHeading = mist.getHeading(PlayerTransportUnit)
|
local playerHeading = mist.getHeading(PlayerTransportUnit)
|
||||||
local playerPoint = PlayerTransportUnit:getPoint()
|
local playerPoint = PlayerTransportUnit:getPoint()
|
||||||
local offset = 5
|
local offset = 5
|
||||||
local randomHeading = ctld.RandomReal(playerHeading - math.pi/4, playerHeading + math.pi/4)
|
|
||||||
for i = 1, v.cratesRequired or 1 do
|
for i = 1, v.cratesRequired or 1 do
|
||||||
-- see to spawn the crate at random position heading the transport unnit
|
-- see to spawn the crate at random position heading the transport unnit
|
||||||
local _unitId = ctld.getNextUnitId()
|
local _unitId = ctld.getNextUnitId()
|
||||||
local _name = string.format("%s_%i", v.desc, _unitId)
|
local _name = string.format("%s_%i", v.desc, _unitId)
|
||||||
local secureDistance = ctld.getSecureDistanceFromUnit(playerUnitName) or 10
|
local secureDistance = ctld.getSecureDistanceFromUnit(playerUnitName) or 10
|
||||||
local relativePoint = ctld.getRelativePoint(playerPoint, secureDistance + (i * offset), randomHeading) -- 7 meters from the transport unit
|
|
||||||
if ctld.unitDynamicCargoCapable(PlayerTransportUnit) == false then
|
if ctld.unitDynamicCargoCapable(PlayerTransportUnit) == false then
|
||||||
|
local randomHeading = ctld.RandomReal(playerHeading - math.pi/4, playerHeading + math.pi/4)
|
||||||
local relativePoint = ctld.getRelativePoint(playerPoint, secureDistance + (i * offset), randomHeading) -- 7 meters from the transport unit
|
local relativePoint = ctld.getRelativePoint(playerPoint, secureDistance + (i * offset), randomHeading) -- 7 meters from the transport unit
|
||||||
ctld.spawnCrateStatic(refCountry, _unitId, relativePoint, _name, crateWeight, playerCoa, playerHeading, nil)
|
ctld.spawnCrateStatic(refCountry, _unitId, relativePoint, _name, crateWeight, playerCoa, playerHeading, nil)
|
||||||
else
|
else
|
||||||
|
local randomHeading = ctld.RandomReal(playerHeading + math.pi - math.pi/4, playerHeading + math.pi + math.pi/4)
|
||||||
local relativePoint = ctld.getRelativePoint(playerPoint, secureDistance + (i * offset), randomHeading) -- 7 meters from the transport unit
|
local relativePoint = ctld.getRelativePoint(playerPoint, secureDistance + (i * offset), randomHeading) -- 7 meters from the transport unit
|
||||||
ctld.spawnCrateStatic(refCountry, _unitId, relativePoint, _name, crateWeight, playerCoa, playerHeading, "dynamic")
|
ctld.spawnCrateStatic(refCountry, _unitId, relativePoint, _name, crateWeight, playerCoa, playerHeading+math.pi, "dynamic")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -8113,7 +8113,7 @@ function ctld.initialize()
|
|||||||
timer.scheduleFunction(ctld.checkHoverStatus, nil, timer.getTime() + 1)
|
timer.scheduleFunction(ctld.checkHoverStatus, nil, timer.getTime() + 1)
|
||||||
end
|
end
|
||||||
if ctld.enableRepackingVehicles == true then
|
if ctld.enableRepackingVehicles == true then
|
||||||
timer.scheduleFunction(ctld.autoUpdateRepackMenu, nil, timer.getTime() + 5)
|
timer.scheduleFunction(ctld.autoUpdateRepackMenu, nil, timer.getTime() + 3)
|
||||||
timer.scheduleFunction(ctld.repackVehicle, nil, timer.getTime() + 1)
|
timer.scheduleFunction(ctld.repackVehicle, nil, timer.getTime() + 1)
|
||||||
end
|
end
|
||||||
end, nil, timer.getTime() + 1)
|
end, nil, timer.getTime() + 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user