From d69dc71e81995e4442bc434368d530cefc790d5f Mon Sep 17 00:00:00 2001 From: Austen Adler Date: Thu, 9 Oct 2014 17:18:57 -0400 Subject: [PATCH] Attempted fixing #5 (Untested) --- src/Zaphod.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Zaphod.cpp b/src/Zaphod.cpp index 4268692..9da7d35 100644 --- a/src/Zaphod.cpp +++ b/src/Zaphod.cpp @@ -254,11 +254,11 @@ public: //}}} //runCompressor{{{ void runCompressor(int i, int refreshInterval){ - if(i%refreshInterval==0&compressing&compressor.GetPressureSwitchValue()==1){ + if(i%refreshInterval==0&&compressing&&compressor.GetPressureSwitchValue()==1){ compressing=false; compressor.Stop(); } - if(i%refreshInterval==0&!compressing&compressor.GetPressureSwitchValue()==0){ + if(i%refreshInterval==0&&!compressing&&compressor.GetPressureSwitchValue()==0&&shooter_idle){ compressing=true; compressor.Start(); } @@ -632,6 +632,8 @@ public: //}}} //Shoot{{{ if(Lstick.GetRawButton(1)==1){ + compressing=false; + compressor.Stop(); shooter_idle=false; //Cause the robot to start the shooting sequence } //}}} @@ -693,5 +695,5 @@ public: } } //}}} -}; +} START_ROBOT_CLASS(RobotDemo);