mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
bla
This commit is contained in:
@@ -2053,19 +2053,26 @@ function WAREHOUSE:_GetIDsFromGroup(group)
|
|||||||
return _wid,_aid,_rid
|
return _wid,_aid,_rid
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Group name
|
if group then
|
||||||
local name=group:GetName()
|
|
||||||
|
|
||||||
-- Get ids
|
-- Group name
|
||||||
local wid,aid,rid=analyse(name)
|
local name=group:GetName()
|
||||||
|
|
||||||
|
-- Get ids
|
||||||
|
local wid,aid,rid=analyse(name)
|
||||||
|
|
||||||
|
-- Debug info
|
||||||
|
self:E(self.wid..string.format("Group Name = %s", tostring(name)))
|
||||||
|
self:E(self.wid..string.format("Warehouse ID = %s", tostring(wid)))
|
||||||
|
self:E(self.wid..string.format("Asset ID = %s", tostring(aid)))
|
||||||
|
self:E(self.wid..string.format("Request ID = %s", tostring(rid)))
|
||||||
|
|
||||||
|
return wid,aid,rid
|
||||||
|
else
|
||||||
|
self:E("WARNING: Group not found in GetIDsFromGroup() function!")
|
||||||
|
end
|
||||||
|
|
||||||
-- Debug info
|
|
||||||
self:E(self.wid..string.format("Group Name = %s", tostring(name)))
|
|
||||||
self:E(self.wid..string.format("Warehouse ID = %s", tostring(wid)))
|
|
||||||
self:E(self.wid..string.format("Asset ID = %s", tostring(aid)))
|
|
||||||
self:E(self.wid..string.format("Request ID = %s", tostring(rid)))
|
|
||||||
|
|
||||||
return wid,aid,rid
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Filter stock assets by table entry.
|
--- Filter stock assets by table entry.
|
||||||
|
|||||||
@@ -1460,9 +1460,11 @@ function GROUP:RespawnAtCurrentAirbase(SpawnTemplate, Takeoff, Uncontrolled) --
|
|||||||
-- Get the units of the group.
|
-- Get the units of the group.
|
||||||
local units=self:GetUnits()
|
local units=self:GetUnits()
|
||||||
|
|
||||||
for UnitID,_unit in pairs(units) do
|
local x
|
||||||
|
local y
|
||||||
|
for UnitID=1,#units do
|
||||||
|
|
||||||
local unit=_unit --Wrapper.Unit#UNIT
|
local unit=units[UnitID] --Wrapper.Unit#UNIT
|
||||||
|
|
||||||
-- Get closest parking spot of current unit. Note that we look for occupied spots since the unit is currently sitting on it!
|
-- Get closest parking spot of current unit. Note that we look for occupied spots since the unit is currently sitting on it!
|
||||||
local Parkingspot, TermialID, Distance=unit:GetCoordinate():GetClosestParkingSpot(airbase)
|
local Parkingspot, TermialID, Distance=unit:GetCoordinate():GetClosestParkingSpot(airbase)
|
||||||
@@ -1472,20 +1474,27 @@ function GROUP:RespawnAtCurrentAirbase(SpawnTemplate, Takeoff, Uncontrolled) --
|
|||||||
|
|
||||||
-- Get unit coordinates for respawning position.
|
-- Get unit coordinates for respawning position.
|
||||||
local uc=unit:GetCoordinate()
|
local uc=unit:GetCoordinate()
|
||||||
SpawnTemplate.units[UnitID].x = Parkingspot.x
|
|
||||||
SpawnTemplate.units[UnitID].y = Parkingspot.z
|
|
||||||
SpawnTemplate.units[UnitID].alt = Parkingspot.y
|
SpawnTemplate.units[UnitID].x = uc.x --Parkingspot.x
|
||||||
|
SpawnTemplate.units[UnitID].y = uc.z --Parkingspot.z
|
||||||
|
SpawnTemplate.units[UnitID].alt = uc.y --Parkingspot.y
|
||||||
|
|
||||||
SpawnTemplate.units[UnitID].parking = TermialID
|
SpawnTemplate.units[UnitID].parking = TermialID
|
||||||
SpawnTemplate.units[UnitID].parking_id = nil
|
SpawnTemplate.units[UnitID].parking_id = nil
|
||||||
|
|
||||||
|
if UnitID==1 then
|
||||||
|
x=uc.x
|
||||||
|
y=uc.z
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
SpawnPoint.x = AirbaseCoord.x
|
SpawnPoint.x = x --AirbaseCoord.x
|
||||||
SpawnPoint.y = AirbaseCoord.z
|
SpawnPoint.y = y --AirbaseCoord.z
|
||||||
|
|
||||||
SpawnTemplate.x = AirbaseCoord.x
|
SpawnTemplate.x = x --AirbaseCoord.x
|
||||||
SpawnTemplate.y = AirbaseCoord.z
|
SpawnTemplate.y = y --AirbaseCoord.z
|
||||||
|
|
||||||
-- Set uncontrolled state.
|
-- Set uncontrolled state.
|
||||||
SpawnTemplate.uncontrolled=Uncontrolled
|
SpawnTemplate.uncontrolled=Uncontrolled
|
||||||
|
|||||||
Reference in New Issue
Block a user