This commit is contained in:
WoodyXP 2024-01-11 17:37:28 +01:00
parent b9201d583c
commit c042d2b6f5
4 changed files with 14 additions and 7 deletions

View File

@ -211,12 +211,13 @@ private:
class SpawnAircrafts : public Command
{
public:
SpawnAircrafts(string coalition, vector<SpawnOptions> spawnOptions, string airbaseName, string country, bool immediate, function<void(void)> callback = [](){}) :
SpawnAircrafts(string coalition, vector<SpawnOptions> spawnOptions, string airbaseName, string country, string skill, bool immediate, function<void(void)> callback = [](){}) :
Command(callback),
coalition(coalition),
spawnOptions(spawnOptions),
airbaseName(airbaseName),
country(country),
skill(skill),
immediate(immediate)
{
priority = immediate ? CommandPriority::IMMEDIATE : CommandPriority::LOW;
@ -229,6 +230,7 @@ private:
const vector<SpawnOptions> spawnOptions;
const string airbaseName;
const string country;
const string skill;
const bool immediate;
};
@ -236,12 +238,13 @@ private:
class SpawnHelicopters : public Command
{
public:
SpawnHelicopters(string coalition, vector<SpawnOptions> spawnOptions, string airbaseName, string country, bool immediate, function<void(void)> callback = [](){}) :
SpawnHelicopters(string coalition, vector<SpawnOptions> spawnOptions, string airbaseName, string country, string skill, bool immediate, function<void(void)> callback = [](){}) :
Command(callback),
coalition(coalition),
spawnOptions(spawnOptions),
airbaseName(airbaseName),
country(country),
skill(skill),
immediate(immediate)
{
priority = immediate ? CommandPriority::IMMEDIATE : CommandPriority::LOW;
@ -254,6 +257,7 @@ private:
const vector<SpawnOptions> spawnOptions;
const string airbaseName;
const string country;
const string skill;
const bool immediate;
};

View File

@ -152,6 +152,7 @@ struct SpawnOptions {
string unitType;
Coords location;
string loadout;
string skill;
string liveryID;
};

View File

@ -106,6 +106,7 @@ string SpawnAircrafts::getString()
<< "coalition = " << "\"" << coalition << "\"" << ", "
<< "airbaseName = \"" << airbaseName << "\", "
<< "country = \"" << country << "\", "
<< "skill = \"" << skill << "\", "
<< "units = " << "{" << unitsSS.str() << "}" << "}";
return commandSS.str();
}
@ -134,6 +135,7 @@ string SpawnHelicopters::getString()
<< "coalition = " << "\"" << coalition << "\"" << ", "
<< "airbaseName = \"" << airbaseName << "\", "
<< "country = \"" << country << "\", "
<< "skill = \"" << skill << "\", "
<< "units = " << "{" << unitsSS.str() << "}" << "}";
return commandSS.str();
}

View File

@ -545,7 +545,7 @@ end
-- loadout: (string, optional) only for air units, must be one of the loadouts defined in unitPayloads.lua
-- payload: (table, optional) overrides loadout, specifies directly the loadout of the unit
-- liveryID: (string, optional)
function Olympus.spawnUnits(spawnTable)
function Olympus.spawnUnits(spawnTable, skill)
Olympus.debug("Olympus.spawnUnits " .. Olympus.serializeTable(spawnTable), 2)
local unitsTable = nil
@ -554,11 +554,11 @@ function Olympus.spawnUnits(spawnTable)
-- Generate the units table and route as per DCS requirements
if spawnTable.category == 'Aircraft' then
unitsTable = Olympus.generateAirUnitsTable(spawnTable.units)
unitsTable = Olympus.generateAirUnitsTable(spawnTable.units, skill)
route = Olympus.generateAirUnitsRoute(spawnTable)
category = 'plane'
elseif spawnTable.category == 'Helicopter' then
unitsTable = Olympus.generateAirUnitsTable(spawnTable.units)
unitsTable = Olympus.generateAirUnitsTable(spawnTable.units, skill)
route = Olympus.generateAirUnitsRoute(spawnTable)
category = 'helicopter'
elseif spawnTable.category == 'GroundUnit' then
@ -1109,9 +1109,9 @@ function Olympus.setUnitsData(arg, time)
-- Generate the units table as per DCS requirements
if table["category"] == 'Aircraft' then
unitsTable = Olympus.generateAirUnitsTable(spawnTable.units)
unitsTable = Olympus.generateAirUnitsTable(spawnTable.units, skill)
elseif table["category"] == 'Helicopter' then
unitsTable = Olympus.generateAirUnitsTable(spawnTable.units)
unitsTable = Olympus.generateAirUnitsTable(spawnTable.units, skill)
elseif table["category"] == 'GroundUnit' then
unitsTable = Olympus.generateGroundUnitsTable(spawnTable.units)
elseif table["category"] == 'NavyUnit' then