Browse Source

change to reflect intended behavior

Signed-off-by: Michał Pełka <[email protected]>
Michał Pełka 2 years ago
parent
commit
4dac3151db

+ 1 - 0
Project/Gem/Source/ApplePicker/ApplePickerComponent.cpp

@@ -279,6 +279,7 @@ namespace AppleKraken
         AZ_TracePrintf(
             "ApplePicker", "%s. Picking failed due to: %s\n", Internal::CurrentTaskString(m_currentAppleTasks).c_str(), reason.c_str());
         m_currentAppleTasks.pop();
+        PickNextApple();
     }
 
     void ApplePickerComponent::PickNextApple()

+ 6 - 1
Project/Gem/Source/ApplePicker/KrakenEffectorComponent.cpp

@@ -156,6 +156,12 @@ namespace AppleKraken
 
     bool KrakenEffectorComponent::IsTransitionAcceptable(EffectorState targetState) const
     {
+        if (m_effectorState == EffectorState::PICKING && m_effectorState == EffectorState::PICKING)
+        {
+            // allow this non-existing state transition without error
+            return true;
+        }
+
         if (m_effectorState != m_effectorTargetState)
         {
             AZ_Error(
@@ -296,7 +302,6 @@ namespace AppleKraken
         {
             AZ_Printf("m_onTriggerHandleBeginHandler", "---------------Failed to retrieve apple--------------------\n");
             ApplePickingNotificationBus::Broadcast(&ApplePickingNotifications::PickingFailed, "Timeout");
-            BeginTransitionIfAcceptable(EffectorState::RETRIEVING);
         }
 
         if (m_effectorState == EffectorState::RETRIEVING)