Skip to content

Commit

Permalink
Vehicle crash reverse fix (#36266)
Browse files Browse the repository at this point in the history
* check autodriving before stop autodriving

* encapsulate in stop autodriving function
davidpwbrown authored and ZhilkinSerg committed Dec 19, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 25cef38 commit 7d2bd18
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/vehicle.cpp
Original file line number Diff line number Diff line change
@@ -735,6 +735,9 @@ std::set<point> vehicle::immediate_path( int rotate )

void vehicle::stop_autodriving()
{
if( !is_autodriving && !is_patrolling && !is_following ){
return;
}
if( velocity > 0 ) {
if( is_patrolling || is_following ) {
autodrive( 0, 10 );

0 comments on commit 7d2bd18

Please sign in to comment.