mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Added increased load for onRoad movement
This commit is contained in:
parent
e677968ba7
commit
e5e7e9be14
@ -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<void(void)> callback = []() {}) :
|
||||
string altitudeType, string taskOptions, string category, bool onRoad, function<void(void)> 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 */
|
||||
|
||||
@ -9,7 +9,6 @@ extern UnitsManager* unitsManager;
|
||||
/* Move command */
|
||||
string Move::getString()
|
||||
{
|
||||
|
||||
std::ostringstream commandSS;
|
||||
commandSS.precision(10);
|
||||
commandSS << "Olympus.move, "
|
||||
|
||||
@ -712,7 +712,7 @@ void Unit::goToDestination(string enrouteTask)
|
||||
{
|
||||
if (activeDestination != NULL)
|
||||
{
|
||||
Command* command = dynamic_cast<Command*>(new Move(groupName, activeDestination, getDesiredSpeed(), getDesiredSpeedType() ? "GS" : "CAS", getDesiredAltitude(), getDesiredAltitudeType() ? "AGL" : "ASL", enrouteTask, getCategory(), [this]() { this->setHasTaskAssigned(true); }));
|
||||
Command* command = dynamic_cast<Command*>(new Move(groupName, activeDestination, getDesiredSpeed(), getDesiredSpeedType() ? "GS" : "CAS", getDesiredAltitude(), getDesiredAltitudeType() ? "AGL" : "ASL", enrouteTask, getCategory(), getFollowRoads(), [this]() { this->setHasTaskAssigned(true); }));
|
||||
scheduler->appendCommand(command);
|
||||
setHasTask(true);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user