diff --git a/backend/core/src/commands.cpp b/backend/core/src/commands.cpp index 377ed71f..e7579d05 100644 --- a/backend/core/src/commands.cpp +++ b/backend/core/src/commands.cpp @@ -95,6 +95,7 @@ string SpawnAircrafts::getString() << "lng = " << spawnOptions[i].location.lng << ", " << "alt = " << spawnOptions[i].location.alt << ", " << "loadout = \"" << spawnOptions[i].loadout << "\"" << ", " + << "skill = \"" << spawnOptions[i].skill << "\"" << ", " << "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << " }, "; } @@ -122,6 +123,7 @@ string SpawnHelicopters::getString() << "lng = " << spawnOptions[i].location.lng << ", " << "alt = " << spawnOptions[i].location.alt << ", " << "loadout = \"" << spawnOptions[i].loadout << "\"" << ", " + << "skill = \"" << spawnOptions[i].skill << "\"" << ", " << "liveryID = " << "\"" << spawnOptions[i].liveryID << "\"" << " }, "; } diff --git a/backend/core/src/scheduler.cpp b/backend/core/src/scheduler.cpp index 42dca980..d121c00d 100644 --- a/backend/core/src/scheduler.cpp +++ b/backend/core/src/scheduler.cpp @@ -203,9 +203,10 @@ void Scheduler::handleRequest(string key, json::value value, string username, js double alt = unit[L"altitude"].as_double(); Coords location; location.lat = lat; location.lng = lng; location.alt = alt; string loadout = to_string(unit[L"loadout"]); + string skill = to_string(unit[L"skill"]); string liveryID = to_string(unit[L"liveryID"]); - spawnOptions.push_back({unitType, location, loadout, liveryID}); + spawnOptions.push_back({unitType, location, loadout, skill, liveryID}); log(username + " spawned a " + coalition + " " + unitType, true); } diff --git a/scripts/lua/backend/OlympusCommand.lua b/scripts/lua/backend/OlympusCommand.lua index 45b366bb..e7da4ce3 100644 --- a/scripts/lua/backend/OlympusCommand.lua +++ b/scripts/lua/backend/OlympusCommand.lua @@ -600,7 +600,7 @@ function Olympus.spawnUnits(spawnTable) end -- Generates unit table for air units -function Olympus.generateAirUnitsTable(units) +function Olympus.generateAirUnitsTable(units, skill) local unitsTable = {} for idx, unit in pairs(units) do local loadout = unit.loadout -- loadout: a string, one of the names defined in unitPayloads.lua. Must be compatible with the unitType @@ -628,7 +628,7 @@ function Olympus.generateAirUnitsTable(units) ["y"] = spawnLocation.z, ["alt"] = unit.alt, ["alt_type"] = "BARO", - ["skill"] = "Excellent", + ["skill"] = skill, ["payload"] = payload, ["heading"] = unit.heading, ["callsign"] = { [1] = 1, [2] = 1, [3] = 1, ["name"] = "Olympus" .. Olympus.unitCounter.. "-" .. #unitsTable + 1 },