Skip to content

Commit

Permalink
Flaming Cliffs: Fix aircraft not working (#921)
Browse files Browse the repository at this point in the history
* Flaming Cliffs: Add new FC2024 aircraft

* Remove dev0 requirement from modules which don't need it

* Add FC2024 modules to NS430 aircraft
  • Loading branch information
charliefoxtwo authored Aug 8, 2024
1 parent ad00a47 commit b79f699
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Scripts/DCS-BIOS/lib/AircraftList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ add("Supercarrier", true)
--FC3
add("A-10A", false)
add("F-15C", false)
add("F-5E-3_FC", false)
add("F-86F_FC", false)
add("J-11A", false)
add("MiG-15bis_FC", false)
add("MiG-29A", false)
add("MiG-29G", false)
add("MiG-29S", false)
Expand Down
1 change: 1 addition & 0 deletions Scripts/DCS-BIOS/lib/BIOSStateMachine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ end
--- @param module Module
--- @param dev0 CockpitDevice?
function BIOSStateMachine:queue_module_data(module, dev0)
dev0 = module.dev0_required and dev0 or {} -- if dev0 isn't required, just pass an empty object
if dev0 ~= nil then
for _, hook in ipairs(module.exportHooks) do
local status, result = pcall(hook, dev0)
Expand Down
2 changes: 2 additions & 0 deletions Scripts/DCS-BIOS/lib/modules/Module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ end
--- @field memoryMap MemoryMap a map of all memory allocations for sending and receiving data
--- @field exportHooks fun(dev0: CockpitDevice)[] functions to run on sending data
--- @field aircraftList string[] list of aircraft ids to export to
--- @field dev0_required boolean
local Module = {}

--- Constructs a new module
Expand All @@ -43,6 +44,7 @@ function Module:new(name, baseAddress, acftList)
memoryMap = MemoryMap:new(baseAddress),
exportHooks = {},
aircraftList = acftList,
dev0_required = true,
}

setmetatable(o, self)
Expand Down
1 change: 1 addition & 0 deletions Scripts/DCS-BIOS/lib/modules/aircraft_modules/FC3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ local Module = require("Scripts.DCS-BIOS.lib.modules.Module")

--- @class FC3: Module
local FC3 = Module:new("FC3", 0x6000, AircraftList.FLAMING_CLIFFS_AIRCRAFT)
FC3.dev0_required = false

local altitude = " -- "
local altitude_ground_level = " ---- "
Expand Down
1 change: 1 addition & 0 deletions Scripts/DCS-BIOS/lib/modules/common_modules/CommonData.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ local Module = require("Scripts.DCS-BIOS.lib.modules.Module")

--- @class CommonData: Module
local CommonData = Module:new("CommonData", 0x0400, AircraftList.ALL_PLAYABLE_AIRCRAFT)
CommonData.dev0_required = false

local latDeg = 0
local latSec = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local Module = require("Scripts.DCS-BIOS.lib.modules.Module")
--- setUpdateCounter
--- setUpdateSkipCounter
local MetadataEnd = Module:new("MetadataEnd", 0xfffe, {})
MetadataEnd.dev0_required = false

local updateCounter = 0
local updateSkipCounter = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local Module = require("Scripts.DCS-BIOS.lib.modules.Module")
--- @class MetadataStart: Module
--- @field setAircraftName function
local MetadataStart = Module:new("MetadataStart", 0x0000, {})
MetadataStart.dev0_required = false

-- "data" will be set by the Protocol module
local aircraft_name
Expand Down
4 changes: 4 additions & 0 deletions Scripts/DCS-BIOS/lib/modules/common_modules/NS430.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ local ns430_aircraft = {
"F-14B",
"F-15C",
"F-5E-3",
"F-5E-3_FC",
"F-86F Sabre",
"F-86F_FC",
"FW-190A8",
"FW-190D9",
"I-16",
Expand All @@ -35,6 +37,7 @@ local ns430_aircraft = {
"Mi-8MT",
"Mi-24P",
"MiG-15bis",
"MiG-15bis_FC",
"MiG-19P",
"MiG-21Bis",
"MiG-29A",
Expand All @@ -61,6 +64,7 @@ local ns430_aircraft = {
}
--- @class NS430: Module
local NS430 = Module:new("NS430", 0x0600, ns430_aircraft)
NS430.dev0_required = false

-- v2.0 by Celemourn
-- v3.0 ArturDCS
Expand Down

0 comments on commit b79f699

Please sign in to comment.