From 630a175a19684b2ea0ee21568477bf0a5dbd4312 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sun, 20 Aug 2023 00:44:50 +0200 Subject: [PATCH] Fix missing transition from air to grab --- content/setting/animation.yaml | 3 +++ include/Game/AnimationTransitions.hpp | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/content/setting/animation.yaml b/content/setting/animation.yaml index b4b3899..fb94869 100644 --- a/content/setting/animation.yaml +++ b/content/setting/animation.yaml @@ -117,6 +117,9 @@ Transitions: StartLeftClicTransition: from: jump to: grab + StartLeftClicTransition: + from: air + to: grab StartLeftClicTransition: from: sleep to: grab diff --git a/include/Game/AnimationTransitions.hpp b/include/Game/AnimationTransitions.hpp index 5a2ff20..0ef67c3 100644 --- a/include/Game/AnimationTransitions.hpp +++ b/include/Game/AnimationTransitions.hpp @@ -87,6 +87,11 @@ struct EndLeftClicTransition : public StateMachine::Node::Transition bool leftWasPressed = false; public: + void onEnter(GameData& blackBoard) final + { + leftWasPressed = blackBoard.leftButtonEvent == GLFW_PRESS; + }; + bool canTransition(GameData& blackBoard) final { if (blackBoard.leftButtonEvent == GLFW_PRESS)