From 309c20647923a7bba0214747111954e49ba6ac02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric?= Date: Thu, 4 Jul 2024 11:04:23 +0200 Subject: [PATCH 1/5] hotfix ability input buffer --- .../GBFAbilityInputBufferComponent.cpp | 34 +++++++++++++------ .../GBFAbilityInputBufferComponent.h | 2 +- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp b/Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp index 1eb14b72..b4caa61e 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(); + // 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/Public/Characters/Components/GBFAbilityInputBufferComponent.h b/Source/GameBaseFramework/Public/Characters/Components/GBFAbilityInputBufferComponent.h index 9b3ca45e..383cf986 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 ) From b5912216936b4e073ad6580116eb7dee9c6c7d6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric?= Date: Thu, 4 Jul 2024 11:41:02 +0200 Subject: [PATCH 2/5] clang --- .../Characters/Components/GBFAbilityInputBufferComponent.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/GameBaseFramework/Public/Characters/Components/GBFAbilityInputBufferComponent.h b/Source/GameBaseFramework/Public/Characters/Components/GBFAbilityInputBufferComponent.h index 383cf986..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, Meta = (GameplayTagFilter = "Input") ) + UFUNCTION( BlueprintCallable, Meta = ( GameplayTagFilter = "Input" ) ) void StartMonitoring( FGameplayTagContainer input_tags_to_check, ETriggerPriority trigger_priority ); UFUNCTION( BlueprintCallable ) From bbf98cb9495cc629766c36e6cb427ee263815879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric?= Date: Thu, 4 Jul 2024 11:49:38 +0200 Subject: [PATCH 3/5] clang again --- .../Private/Experiences/GBFUserFacingExperienceDefinition.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 >(); From 1819742b62a832d5593eb75483bb8183c3136309 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric?= Date: Thu, 4 Jul 2024 12:09:05 +0200 Subject: [PATCH 4/5] add git fix issue --- .../Characters/Components/GBFAbilityInputBufferComponent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp b/Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp index b4caa61e..7fef9242 100644 --- a/Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp +++ b/Source/GameBaseFramework/Private/Characters/Components/GBFAbilityInputBufferComponent.cpp @@ -97,7 +97,7 @@ void UGBFAbilityInputBufferComponent::BindActions() return; } - // mg Ability input config is null, comment for hotfix + // :FIXME: mg Ability input config is null, comment for hotfix // for ( auto & input_config : hero_component->GetBoundActionsByInputconfig() ) // { From abec739e7b0be5a51661e541357c9cff3a66bad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric?= Date: Thu, 4 Jul 2024 12:15:55 +0200 Subject: [PATCH 5/5] add object initializer --- .../Public/Characters/GBFSimpleCharacterWithAbilities.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;