]> git.mxchange.org Git - flightgear.git/commitdiff
- check for null property before trying to copy properties
authorcurt <curt>
Thu, 14 Jun 2001 20:25:39 +0000 (20:25 +0000)
committercurt <curt>
Thu, 14 Jun 2001 20:25:39 +0000 (20:25 +0000)
src/Input/input.cxx

index 2a865002f176fc2d0a6a4c70767caa6dd8f875f3..d6f41bb8d19d36f6bdd141e1c7a95af6ddd5d468 100644 (file)
@@ -133,7 +133,8 @@ void
 FGBinding::fire (double setting) const
 {
   SGPropertyNode arg;
 FGBinding::fire (double setting) const
 {
   SGPropertyNode arg;
-  copyProperties(_arg, &arg);
+  if (_arg != 0)
+    copyProperties(_arg, &arg);
   arg.setDoubleValue("setting", setting);
   _fire(&arg);
 }
   arg.setDoubleValue("setting", setting);
   _fire(&arg);
 }
@@ -199,6 +200,9 @@ FGInput::update ()
 void
 FGInput::doKey (int k, int modifiers, int x, int y)
 {
 void
 FGInput::doKey (int k, int modifiers, int x, int y)
 {
+  SG_LOG(SG_INPUT, SG_INFO, "User pressed key " << k
+        << " with modifiers " << modifiers);
+
                                // Sanity check.
   if (k < 0 || k >= MAX_KEYS) {
     SG_LOG(SG_INPUT, SG_ALERT, "Key value " << k << " out of range");
                                // Sanity check.
   if (k < 0 || k >= MAX_KEYS) {
     SG_LOG(SG_INPUT, SG_ALERT, "Key value " << k << " out of range");
@@ -209,8 +213,8 @@ FGInput::doKey (int k, int modifiers, int x, int y)
 
                                // Key pressed.
   if (modifiers&FG_MOD_UP == 0) {
 
                                // Key pressed.
   if (modifiers&FG_MOD_UP == 0) {
-    // SG_LOG(SG_INPUT, SG_INFO, "User pressed key " << k
-    //        << " with modifiers " << modifiers);
+    // SG_LOG( SG_INPUT, SG_INFO, "User pressed key " << k
+    //         << " with modifiers " << modifiers );
     if (!b.last_state || b.is_repeatable) {
       const binding_list_t &bindings =
        _find_key_bindings(k, modifiers);
     if (!b.last_state || b.is_repeatable) {
       const binding_list_t &bindings =
        _find_key_bindings(k, modifiers);