try to fix bug: BAirboss:setTACAN not working fine at MPserver and server only.

This commit is contained in:
2025-01-03 18:23:11 +08:00
parent 8a9718798d
commit f30c1a25fb
2 changed files with 33 additions and 12 deletions
+30 -10
View File
@@ -132,7 +132,8 @@ do
return
end
local obj = Utils.deepCopy(self)
-- local obj = Utils.deepCopy(self)
local obj = {}
obj.carrierUnit = Unit.getByName(carrierUnitName)
@@ -145,15 +146,13 @@ do
return nil
end
-- setmetatable(obj,self)
-- self.__index = self
setmetatable(obj,self)
self.__index = self
obj:setMorse()
obj:setTACAN()
obj:setICLS()
obj:setLink4()
obj:setACLS(true)
obj:setATC()
timer.scheduleFunction(function (vars)
local carrier = vars.context
carrier:InitBeacons()
end,{context = obj},timer.getTime()+5)
-- self:setMorse()
-- self:setTACAN()
@@ -162,6 +161,7 @@ do
-- self:setACLS(true)
-- self:setATC()
env.info('BAirboss - New Carrier: '..carrierUnitName)
return obj
end
@@ -371,7 +371,10 @@ do
type = 4,
system = 3,
callsign = self.Morse,
frequency = Utils.TACANToFrequency(self.TACAN, self.TACAN_Mode)
frequency = Utils.TACANToFrequency(self.TACAN, self.TACAN_Mode),
channel = Channel,
bearing = true,
modeChannel = Mode,
}
}
@@ -457,6 +460,23 @@ do
return self
end
function BAirboss:InitBeacons()
self:setMorse()
self:setICLS()
self:setLink4()
self:setACLS(true)
self:setATC()
self:setTACAN()
return self
end
end
+3 -2
View File
@@ -337,7 +337,7 @@ do
self:createMenu(playerGroup)
local enterText = Localizations:translate('You have entered range area, you can sapwn targets through radio F10 menu.','cn')
trigger.action.outTextForGroup()
trigger.action.outTextForGroup(playerGroup:getID(),enterText,10)
end
function Range:removePlayerProfile(playerName)
@@ -351,6 +351,7 @@ do
self.playerList[playerName] = nil
local leaveText = Localizations:translate('You have left rang area.','cn')
trigger.action.outTextForGroup(self.playerList[playerName].groupID,leaveText,10)
end
function Range:activeTartgets(playerName,sectionType,targetType,AAType,Move)
@@ -410,7 +411,7 @@ do
end
if not sectionZone then
trigger.action.outTextForGroup(string.format(Localizations:translate('There is no range section of %s left.','cn'),Localizations:translate(sectionType,'cn')))
trigger.action.outTextForGroup(string.format(Localizations:translate('There is no range section of %s left.','cn'),Localizations:translate(sectionType,'cn')),10)
return
end