Compare commits

...
2 Commits
3 changed files with 23 additions and 19 deletions
Binary file not shown.
+17 -12
View File
@@ -149,20 +149,20 @@ do
-- setmetatable(obj,self) -- setmetatable(obj,self)
-- self.__index = self -- self.__index = self
-- timer.scheduleFunction(function (vars)
-- local carrier = vars.context
-- carrier:InitBeacons()
-- end,{context = obj},timer.getTime()+5)
timer.scheduleFunction(function (vars) timer.scheduleFunction(function (vars)
local carrier = vars.context local carrier = vars.context
carrier:setTACAN() carrier:InitBeacons()
carrier:setICLS() end,{context = obj},timer.getTime()+5)
end,{context = obj},timer.getTime()+20)
obj:setMorse() -- timer.scheduleFunction(function (vars)
obj:setLink4() -- local carrier = vars.context
obj:setATC() -- carrier:setTACAN()
-- carrier:setICLS()
-- end,{context = obj},timer.getTime()+20)
-- obj:setMorse()
-- obj:setLink4()
-- obj:setATC()
-- obj:setTACAN() -- obj:setTACAN()
env.info('BAirboss - New Carrier: '..carrierUnitName) env.info('BAirboss - New Carrier: '..carrierUnitName)
@@ -232,7 +232,7 @@ do
--Calculate wind speed on runway in knots. If wind speed < 25 knots, try to make it 25 knots on deck. --Calculate wind speed on runway in knots. If wind speed < 25 knots, try to make it 25 knots on deck.
if windSpeed <= 20/1.944 then if windSpeed <= 20/1.944 then
carrierSpeed = 25/1.944-windSpeed carrierSpeed = 20/1.944-windSpeed
end end
-- Find available waypoint and path. -- Find available waypoint and path.
@@ -315,6 +315,11 @@ do
Controller:setTask(Mission) Controller:setTask(Mission)
end,Mission,timer.getTime()+Delay) end,Mission,timer.getTime()+Delay)
timer.scheduleFunction(function (vars)
local carrier = vars.context
carrier:InitBeacons()
end,{context = self},timer.getTime()+5)
return self return self
end end
+6 -7
View File
@@ -124,6 +124,9 @@ do
self.removePlayerProfile(playerName) self.removePlayerProfile(playerName)
end end
end end
if not playerUnit then
self.removePlayerProfile(playerName)
end
if data.activeTarget then if data.activeTarget then
if data.activeTarget:isExist() then if data.activeTarget:isExist() then
@@ -350,7 +353,7 @@ do
self.playerList[playerName] = nil self.playerList[playerName] = nil
local leaveText = Localizations:translate('You have left rang area.','cn') -- local leaveText = Localizations:translate('You have left rang area.','cn')
-- if self.playerList[playerName].group:isExist() then -- if self.playerList[playerName].group:isExist() then
-- trigger.action.outTextForGroup(self.playerList[playerName].groupID,leaveText,10) -- trigger.action.outTextForGroup(self.playerList[playerName].groupID,leaveText,10)
@@ -469,6 +472,8 @@ do
for k=2,#groupData.units,1 do for k=2,#groupData.units,1 do
local tDir = math.random(0,359) local tDir = math.random(0,359)
local spawnPoint = {} local spawnPoint = {}
spawnPoint.x = centerPoint.x+200
spawnPoint.y = centerPoint.z or centerPoint.y
for i=1,100,1 do for i=1,100,1 do
local tPoint = Utils.vecTranslate(centerPoint,tDir,math.random(100,1000)) --Spawn range local tPoint = Utils.vecTranslate(centerPoint,tDir,math.random(100,1000)) --Spawn range
@@ -480,12 +485,6 @@ do
end end
end end
if not spawnPoint then
spawnPoint.x = centerPoint.x+50
spawnPoint.y = centerPoint.z or centerPoint.y
spawnPoint.y = spawnPoint.y+50
end
groupData.units[k].x = spawnPoint.x groupData.units[k].x = spawnPoint.x
groupData.units[k].y = spawnPoint.z or spawnPoint.y groupData.units[k].y = spawnPoint.z or spawnPoint.y
end end