@@ -164,6 +164,7 @@ function dcsbot.getAirbases(json)
164164 local airdromes = Terrain .GetTerrainConfig (" Airdromes" )
165165 if (airdromes == nil ) then
166166 utils .sendBotTable (msg , json .channel )
167+ return
167168 end
168169 for airdromeID , airdrome in pairs (airdromes ) do
169170 if (airdrome .reference_point ) and (airdrome .abandoned ~= true ) then
@@ -211,6 +212,41 @@ function dcsbot.getAirbases(json)
211212 airbase .dynamic = DCS .getDynamicSpawnSettings (airdromeID , true )
212213 table.insert (msg .airbases , airbase )
213214 end
215+ end
216+ local farpsAndCarriers = DCS .getFarpsAndCarriersMissionData ()
217+ for carrierID , carrier in pairs (farpsAndCarriers .carriers ) do
218+ local airbase = {}
219+ airbase .name = carrier .name
220+ airbase .type = carrier .type
221+ airbase .coalition = carrier .coalition
222+ airbase .lat , airbase .lng = Terrain .convertMetersToLatLon (carrier .x , carrier .y )
223+ airbase .alt = Terrain .GetHeight (carrier .x , carrier .y )
224+ airbase .position = {}
225+ airbase .position .x = carrier .x
226+ airbase .position .y = airbase .alt
227+ airbase .position .z = carrier .y
228+ airbase .dynamic = DCS .getDynamicSpawnSettings (carrierID , true ) or {
229+ dynamicSpawnAvailable = false ,
230+ allowHotSpawn = false
231+ }
232+ table.insert (msg .airbases , airbase )
233+ end
234+ for farpID , farp in pairs (farpsAndCarriers .farps ) do
235+ local airbase = {}
236+ airbase .name = farp .name
237+ airbase .type = farp .type
238+ airbase .coalition = farp .coalition
239+ airbase .lat , airbase .lng = Terrain .convertMetersToLatLon (farp .x , farp .y )
240+ airbase .alt = Terrain .GetHeight (farp .x , farp .y )
241+ airbase .position = {}
242+ airbase .position .x = farp .x
243+ airbase .position .y = airbase .alt
244+ airbase .position .z = farp .y
245+ airbase .dynamic = DCS .getDynamicSpawnSettings (farpID , true ) or {
246+ dynamicSpawnAvailable = false ,
247+ allowHotSpawn = false
248+ }
249+ table.insert (msg .airbases , airbase )
214250 end
215251 utils .sendBotTable (msg , json .channel )
216252end
0 commit comments