mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
#CTLD Fix for Beacon Zone disappearing too fast
This commit is contained in:
parent
37b1e7366c
commit
508e36d327
@ -3522,7 +3522,12 @@ function CTLD:AddCTLDZone(Name, Type, Color, Active, HasBeacon, Shiplength, Ship
|
||||
ctldzone.name = Name or "NONE"
|
||||
ctldzone.type = Type or CTLD.CargoZoneType.MOVE -- #CTLD.CargoZoneType
|
||||
ctldzone.hasbeacon = HasBeacon or false
|
||||
|
||||
|
||||
if Type == CTLD.CargoZoneType.BEACON then
|
||||
self.droppedbeaconref[ctldzone.name] = zone:GetCoordinate()
|
||||
ctldzone.timestamp = timer.getTime()
|
||||
end
|
||||
|
||||
if HasBeacon then
|
||||
ctldzone.fmbeacon = self:_GetFMBeacon(Name)
|
||||
ctldzone.uhfbeacon = self:_GetUHFBeacon(Name)
|
||||
@ -3611,7 +3616,7 @@ function CTLD:CheckDroppedBeacons()
|
||||
|
||||
for _,_beacon in pairs (self.droppedBeacons) do
|
||||
local beacon = _beacon -- #CTLD.CargoZone
|
||||
if not beacon.timestamp then beacon.timestamp = timer.getTime() end
|
||||
if not beacon.timestamp then beacon.timestamp = timer.getTime() + timeout end
|
||||
local T0 = beacon.timestamp
|
||||
if timer.getTime() - T0 > timeout then
|
||||
local name = beacon.name
|
||||
@ -3686,15 +3691,19 @@ function CTLD:_AddRadioBeacon(Name, Sound, Mhz, Modulation, IsShip, IsDropped)
|
||||
if IsDropped and Zone then
|
||||
local ZoneCoord = Zone
|
||||
local ZoneVec3 = ZoneCoord:GetVec3()
|
||||
local Frequency = Mhz * 1000000 -- Freq in Hertz
|
||||
local Frequency = string.format("%09d",Mhz * 1000000) -- Freq in Hertz
|
||||
local Sound = "l10n/DEFAULT/"..Sound
|
||||
trigger.action.radioTransmission(Sound, ZoneVec3, Modulation, false, Frequency, 1000) -- Beacon in MP only runs for 30secs straight
|
||||
--local status = string.format("***** Beacon added Freq %s Mod %s", Mhz, UTILS.GetModulationName(Modulation))
|
||||
--MESSAGE:New(status,10,"Debug"):ToLogIf(self.debug)
|
||||
elseif Zone then
|
||||
local ZoneCoord = Zone:GetCoordinate(2)
|
||||
local ZoneVec3 = ZoneCoord:GetVec3()
|
||||
local Frequency = Mhz * 1000000 -- Freq in Hertz
|
||||
local Frequency = string.format("%09d",Mhz * 1000000) -- Freq in Hertz
|
||||
local Sound = "l10n/DEFAULT/"..Sound
|
||||
trigger.action.radioTransmission(Sound, ZoneVec3, Modulation, false, Frequency, 1000) -- Beacon in MP only runs for 30secs straight
|
||||
--local status = string.format("***** Beacon added Freq %s Mod %s", Mhz, UTILS.GetModulationName(Modulation))
|
||||
--MESSAGE:New(status,10,"Debug"):ToLogIf(self.debug)
|
||||
end
|
||||
return self
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user