From 7ed6c1e050a00f66e85043b658fab868abb2fcd3 Mon Sep 17 00:00:00 2001 From: Syntriax Date: Sat, 27 Jan 2024 14:47:29 +0300 Subject: [PATCH] fix: RotatableBehaviour Not Assigning KeyboardInputsBehaviour when It's Missing --- Game/Behaviours/RotatableBehaviour.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Game/Behaviours/RotatableBehaviour.cs b/Game/Behaviours/RotatableBehaviour.cs index 15f3201..09185c4 100644 --- a/Game/Behaviours/RotatableBehaviour.cs +++ b/Game/Behaviours/RotatableBehaviour.cs @@ -1,7 +1,3 @@ -using Microsoft.Xna.Framework; - -using Apos.Shapes; - using Syntriax.Engine.Core; namespace Pong.Behaviours; @@ -12,8 +8,8 @@ public class RotatableBehaviour : BehaviourOverride protected override void OnFirstActiveFrame() { - if (BehaviourController.TryGetBehaviour(out inputs)) - inputs.BehaviourController.AddBehaviour(); + if (!BehaviourController.TryGetBehaviour(out inputs)) + inputs = BehaviourController.AddBehaviour(); } protected override void OnUpdate()