mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Feat: added backend ability to set spawn heading
This commit is contained in:
@@ -202,12 +202,16 @@ void Scheduler::handleRequest(string key, json::value value, string username, js
|
||||
double lat = unit[L"location"][L"lat"].as_double();
|
||||
double lng = unit[L"location"][L"lng"].as_double();
|
||||
double alt = unit[L"altitude"].as_double();
|
||||
double heading = 0;
|
||||
if (unit.has_number_field(L"heading"))
|
||||
heading = unit[L"heading"].as_double();
|
||||
|
||||
Coords location; location.lat = lat; location.lng = lng; location.alt = alt;
|
||||
string loadout = to_string(unit[L"loadout"]);
|
||||
string liveryID = to_string(unit[L"liveryID"]);
|
||||
string skill = to_string(unit[L"skill"]);
|
||||
|
||||
spawnOptions.push_back({unitType, location, loadout, skill, liveryID});
|
||||
spawnOptions.push_back({unitType, location, loadout, skill, liveryID, heading});
|
||||
log(username + " spawned a " + coalition + " " + unitType , true);
|
||||
}
|
||||
|
||||
@@ -231,11 +235,15 @@ void Scheduler::handleRequest(string key, json::value value, string username, js
|
||||
string unitType = to_string(unit[L"unitType"]);
|
||||
double lat = unit[L"location"][L"lat"].as_double();
|
||||
double lng = unit[L"location"][L"lng"].as_double();
|
||||
double heading = 0;
|
||||
if (unit.has_number_field(L"heading"))
|
||||
heading = unit[L"heading"].as_double();
|
||||
|
||||
Coords location; location.lat = lat; location.lng = lng;
|
||||
string liveryID = to_string(unit[L"liveryID"]);
|
||||
string skill = to_string(unit[L"skill"]);
|
||||
|
||||
spawnOptions.push_back({ unitType, location, "", skill, liveryID});
|
||||
spawnOptions.push_back({ unitType, location, "", skill, liveryID, heading});
|
||||
log(username + " spawned a " + coalition + " " + unitType, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user