Added stop command to helicopters

This commit is contained in:
Pax1601 2023-10-11 12:55:41 +02:00
parent 3c65aefe61
commit a29eb3d343

View File

@ -45,10 +45,7 @@ Helicopter::Helicopter(json::value json, unsigned int ID) : AirUnit(json, ID)
void Helicopter::changeSpeed(string change)
{
if (change.compare("stop") == 0)
{
/* Air units can't hold a position, so we can only set them to hold. At the moment, this will erase any other command. TODO: helicopters should be able to hover in place */
clearActivePath();
}
setState(State::IDLE);
else if (change.compare("slow") == 0)
desiredSpeed -= knotsToMs(10);
else if (change.compare("fast") == 0)