// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
+// for some obscure reason, MSVC needs this to compile
+#ifdef _MSC_VER
+#ifndef HAVE_CONFIG_H
+# include <config.h>
+#endif
+#include <simgear/math/SGMath.hxx>
+#endif
+
#include "logic.hxx"
using namespace FGXMLAutopilot;
if( _inverted ) value = !value;
// set all outputs to the given value
- for( OutputMap::iterator it = _output.begin(); it != _output.end(); it++ )
+ for( OutputMap::iterator it = _output.begin(); it != _output.end(); ++it )
(*it).second->setValue( value );
}
bool Logic::get_output() const
{
OutputMap::const_iterator it = _output.begin();
- return it != _output.end() ? (*it).second->getValue() : false;
+ bool q = it != _output.end() ? (*it).second->getValue() : false;
+ return _inverted ? !q : q;
}
void Logic::update( bool firstTime, double dt )