From a29eb3d3436fb24fb9cc55ad63013aacce0feabe Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Wed, 11 Oct 2023 12:55:41 +0200 Subject: [PATCH] Added stop command to helicopters --- src/core/src/helicopter.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/core/src/helicopter.cpp b/src/core/src/helicopter.cpp index bfd6caab..c452f118 100644 --- a/src/core/src/helicopter.cpp +++ b/src/core/src/helicopter.cpp @@ -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)