diff --git a/Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp b/Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp index 1eb14b72..7fef9242 100644 --- a/Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp +++ b/Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp @@ -2,6 +2,7 @@ #include "Characters/Components/GBFHeroComponent.h" #include "Characters/Components/GBFPawnExtensionComponent.h" +#include "Characters/GBFPawnData.h" #include "GAS/Components/GBFAbilitySystemComponent.h" #include "Input/GBFInputComponent.h" @@ -32,6 +33,11 @@ void UGBFAbilityInputBufferComponent::StartMonitoring( FGameplayTagContainer inp return; } + if ( GetPawn< APawn >() == nullptr || GetPawn< APawn >()->IsBotControlled() ) + { + return; + } + Reset(); TriggerPriority = trigger_priority; InputTagsToCheck = input_tags_to_check; @@ -44,6 +50,11 @@ void UGBFAbilityInputBufferComponent::StartMonitoring( FGameplayTagContainer inp void UGBFAbilityInputBufferComponent::StopMonitoring() { + if ( GetPawn< APawn >() == nullptr || GetPawn< APawn >()->IsBotControlled() ) + { + return; + } + RemoveBinds(); TryToTriggerAbility(); Reset(); @@ -86,18 +97,19 @@ void UGBFAbilityInputBufferComponent::BindActions() return; } - auto & actions_per_input_config = hero_component->GetBoundActionsByInputconfig(); + // :FIXME: mg Ability input config is null, comment for hotfix - for ( auto & [ input_config, actions ] : actions_per_input_config ) - { - for ( auto & tag : InputTagsToCheck ) - { - if ( const auto * input_action = input_config->FindAbilityInputActionForTag( tag ) ) - { - BindHandles.Add( input_component->BindAction( input_action, ETriggerEvent::Triggered, this, &ThisClass::AbilityInputTagPressed, tag ).GetHandle() ); - } - } - } + // for ( auto & input_config : hero_component->GetBoundActionsByInputconfig() ) + // { + // for ( auto & tag : InputTagsToCheck ) + // { + // if ( const auto * input_action = input_config.Key->FindAbilityInputActionForTag( tag ) ) + // { + // // Need to investigate why input is bind but not triggered + // BindHandles.Add( input_component->BindAction( input_action, ETriggerEvent::Triggered, this, &ThisClass::AbilityInputTagPressed, tag ).GetHandle() ); + // } + // } + // } } void UGBFAbilityInputBufferComponent::RemoveBinds() diff --git a/Source/GameBaseFramework/Private/Experiences/GBFUserFacingExperienceDefinition.cpp b/Source/GameBaseFramework/Private/Experiences/GBFUserFacingExperienceDefinition.cpp index 4d368ef4..d687cec1 100644 --- a/Source/GameBaseFramework/Private/Experiences/GBFUserFacingExperienceDefinition.cpp +++ b/Source/GameBaseFramework/Private/Experiences/GBFUserFacingExperienceDefinition.cpp @@ -42,7 +42,7 @@ UCommonSession_HostSessionRequest * UGBFUserFacingExperienceDefinition::CreateHo } } } - + if ( result == nullptr ) { result = NewObject< UCommonSession_HostSessionRequest >(); diff --git a/Source/GameBaseFramework/Public/Characters/Components/GBFAbilityInputBufferComponent.h b/Source/GameBaseFramework/Public/Characters/Components/GBFAbilityInputBufferComponent.h index 9b3ca45e..12d0c6d0 100644 --- a/Source/GameBaseFramework/Public/Characters/Components/GBFAbilityInputBufferComponent.h +++ b/Source/GameBaseFramework/Public/Characters/Components/GBFAbilityInputBufferComponent.h @@ -21,7 +21,7 @@ class GAMEBASEFRAMEWORK_API UGBFAbilityInputBufferComponent final : public UPawn public: UGBFAbilityInputBufferComponent( const FObjectInitializer & object_initializer ); - UFUNCTION( BlueprintCallable ) + UFUNCTION( BlueprintCallable, Meta = ( GameplayTagFilter = "Input" ) ) void StartMonitoring( FGameplayTagContainer input_tags_to_check, ETriggerPriority trigger_priority ); UFUNCTION( BlueprintCallable ) diff --git a/Source/GameBaseFramework/Public/Characters/GBFSimpleCharacterWithAbilities.h b/Source/GameBaseFramework/Public/Characters/GBFSimpleCharacterWithAbilities.h index 794c9921..52b74a53 100644 --- a/Source/GameBaseFramework/Public/Characters/GBFSimpleCharacterWithAbilities.h +++ b/Source/GameBaseFramework/Public/Characters/GBFSimpleCharacterWithAbilities.h @@ -24,7 +24,7 @@ class GAMEBASEFRAMEWORK_API AGBFSimpleCharacterWithAbilities : public ACharacter GENERATED_BODY() public: - explicit AGBFSimpleCharacterWithAbilities( const FObjectInitializer & object_initializer ); + explicit AGBFSimpleCharacterWithAbilities( const FObjectInitializer & object_initializer = FObjectInitializer::Get() ); UAbilitySystemComponent * GetAbilitySystemComponent() const override; void PostInitializeComponents() override;