From 86b7f1b26a7b957a656967348b21295810ed91a1 Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 14 Jun 2001 20:25:39 +0000 Subject: [PATCH] - check for null property before trying to copy properties --- src/Input/input.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Input/input.cxx b/src/Input/input.cxx index 2a865002f..d6f41bb8d 100644 --- a/src/Input/input.cxx +++ b/src/Input/input.cxx @@ -133,7 +133,8 @@ void FGBinding::fire (double setting) const { SGPropertyNode arg; - copyProperties(_arg, &arg); + if (_arg != 0) + copyProperties(_arg, &arg); arg.setDoubleValue("setting", setting); _fire(&arg); } @@ -199,6 +200,9 @@ FGInput::update () 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"); @@ -209,8 +213,8 @@ FGInput::doKey (int k, int modifiers, int x, int y) // 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); -- 2.39.2