From 722e99a768fe46e86a8f04e1a194793fadb8e2fd Mon Sep 17 00:00:00 2001 From: Andreas Aakvik Gogstad Date: Sun, 27 Jul 2014 23:11:15 +0200 Subject: [PATCH] error feedback for missing transforms in flight stick prop --- Firespitter/cockpit/FSinternalPropRotator.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Firespitter/cockpit/FSinternalPropRotator.cs b/Firespitter/cockpit/FSinternalPropRotator.cs index 4ea3738d..3ff28de0 100644 --- a/Firespitter/cockpit/FSinternalPropRotator.cs +++ b/Firespitter/cockpit/FSinternalPropRotator.cs @@ -29,6 +29,7 @@ public class FSinternalPropRotator : InternalModule private float smoothBrake = 0f; private int brakeActionInt = 0; private bool firstRun = true; + Firespitter.info.FSdebugMessages debug = new Firespitter.info.FSdebugMessages(true, "FSinternalPropRotator"); @@ -50,22 +51,28 @@ private void rotateParts(Vector3 rotation) public override void OnAwake() { - if (this.pitchTransform != null) return; + if (pitchTransform != null) return; if (pitchObject != "none") { usePitch = true; - this.pitchTransform = base.internalProp.FindModelTransform(this.pitchObject); + pitchTransform = base.internalProp.FindModelTransform(pitchObject); + if (pitchTransform == null) + debug.debugMessage("Could not find pitch transform " + pitchObject); } if (rollObject != "none") { useRoll = true; - this.rollTransform = base.internalProp.FindModelTransform(this.rollObject); + rollTransform = base.internalProp.FindModelTransform(rollObject); + if (rollTransform == null) + debug.debugMessage("Could not find roll transform " + rollTransform); } if (yawObject != "none") { useYaw = true; - this.yawTransform = base.internalProp.FindModelTransform(this.yawObject); + yawTransform = base.internalProp.FindModelTransform(yawObject); + if (yawTransform == null) + debug.debugMessage("Could not find yaw transform " + yawObject); } brakeActionInt = BaseAction.GetGroupIndex(KSPActionGroup.Brakes);