diff --git a/src/core/include/commands.h b/src/core/include/commands.h index 32cb71ba..2badd091 100644 --- a/src/core/include/commands.h +++ b/src/core/include/commands.h @@ -113,7 +113,7 @@ class Move : public Command { public: Move(string groupName, Coords destination, double speed, string speedType, double altitude, - string altitudeType, string taskOptions, string category, function callback = []() {}) : + string altitudeType, string taskOptions, string category, bool onRoad, function callback = []() {}) : Command(callback), groupName(groupName), destination(destination), @@ -122,12 +122,13 @@ public: altitude(altitude), altitudeType(altitudeType), taskOptions(taskOptions), - category(category) + category(category), + onRoad(onRoad) { priority = CommandPriority::MEDIUM; }; virtual string getString(); - virtual unsigned int getLoad() { return 5; } + virtual unsigned int getLoad() { return onRoad? 45: 5; } private: const string groupName; @@ -138,6 +139,7 @@ private: const string altitudeType; const string taskOptions; const string category; + const bool onRoad; }; /* Smoke command */ diff --git a/src/core/src/commands.cpp b/src/core/src/commands.cpp index 9910ff9d..377ed71f 100644 --- a/src/core/src/commands.cpp +++ b/src/core/src/commands.cpp @@ -9,7 +9,6 @@ extern UnitsManager* unitsManager; /* Move command */ string Move::getString() { - std::ostringstream commandSS; commandSS.precision(10); commandSS << "Olympus.move, " diff --git a/src/core/src/unit.cpp b/src/core/src/unit.cpp index 6e6959a0..f35c5c1f 100644 --- a/src/core/src/unit.cpp +++ b/src/core/src/unit.cpp @@ -712,7 +712,7 @@ void Unit::goToDestination(string enrouteTask) { if (activeDestination != NULL) { - Command* command = dynamic_cast(new Move(groupName, activeDestination, getDesiredSpeed(), getDesiredSpeedType() ? "GS" : "CAS", getDesiredAltitude(), getDesiredAltitudeType() ? "AGL" : "ASL", enrouteTask, getCategory(), [this]() { this->setHasTaskAssigned(true); })); + Command* command = dynamic_cast(new Move(groupName, activeDestination, getDesiredSpeed(), getDesiredSpeedType() ? "GS" : "CAS", getDesiredAltitude(), getDesiredAltitudeType() ? "AGL" : "ASL", enrouteTask, getCategory(), getFollowRoads(), [this]() { this->setHasTaskAssigned(true); })); scheduler->appendCommand(command); setHasTask(true); }