From 9f72aca7dad0950964f699e60722c4953f511ba4 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Wed, 24 Apr 2024 10:07:23 -0400 Subject: [PATCH] 38. Instant Gameplay Effects --- .../Win64/UnrealEditor-GasaEditor.dll | 2 +- .../Gasa/AbilitySystem/GasaEffectActor.cpp | 3 ++- Project/Source/Gasa/Game/GasaGameState.cpp | 19 +++++++++---------- .../Source/Gasa/Game/GasaLevelScriptActor.h | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Project/Binaries/Win64/UnrealEditor-GasaEditor.dll b/Project/Binaries/Win64/UnrealEditor-GasaEditor.dll index 9e6db4c..bfd2082 100644 --- a/Project/Binaries/Win64/UnrealEditor-GasaEditor.dll +++ b/Project/Binaries/Win64/UnrealEditor-GasaEditor.dll @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cb9da4955b87ca673e2193c41b05cdc57340e70334ddc52b5cfdbad0792583f1 +oid sha256:36bd29b06747f05f67c12ab6dcce9e0da7f419b2e02c9051327cf1419f07ddbd size 79360 diff --git a/Project/Source/Gasa/AbilitySystem/GasaEffectActor.cpp b/Project/Source/Gasa/AbilitySystem/GasaEffectActor.cpp index e8e8559..f4b4783 100644 --- a/Project/Source/Gasa/AbilitySystem/GasaEffectActor.cpp +++ b/Project/Source/Gasa/AbilitySystem/GasaEffectActor.cpp @@ -19,5 +19,6 @@ void AGasaEffectActor::ApplyEffectToActor(AActor* Actor, TSubclassOfMakeOutgoingSpec( EffectClass, 1.0f, Context ); - AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); + if (Spec.IsValid()) + AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); } diff --git a/Project/Source/Gasa/Game/GasaGameState.cpp b/Project/Source/Gasa/Game/GasaGameState.cpp index 19b03b4..2cfadd6 100644 --- a/Project/Source/Gasa/Game/GasaGameState.cpp +++ b/Project/Source/Gasa/Game/GasaGameState.cpp @@ -29,7 +29,6 @@ AGasaGameState::AGasaGameState() void AGasaGameState::OnGameFrameworkInitialized() { NetLog("Received gameplay framework initialization."); - if (IsServer()) { if (PlayerArray.Num() > 0) @@ -41,7 +40,6 @@ void AGasaGameState::OnGameFrameworkInitialized() NetLog("Was not able to assign HostingPlayer!", ELogV::Error); } } - BP_OnGameFrameworkInitialized(); } #pragma endregion GameFramework @@ -71,7 +69,6 @@ void AGasaGameState::HandleBeginPlay() void AGasaGameState::SeamlessTravelTransitionCheckpoint(bool bToTransitionMap) { Super::SeamlessTravelTransitionCheckpoint(bToTransitionMap); - NetLog("SeamlessTravelTransitionCheckpoint"); NetLog(FString("ToTransitionMap: ") + FString(bToTransitionMap ? "true" : "false")); @@ -90,7 +87,6 @@ void AGasaGameState::SeamlessTravelTransitionCheckpoint(bool bToTransitionMap) void AGasaGameState::BeginPlay() { Super::BeginPlay(); - NetLog("BeginPlay"); // Notified as initialized here as any possible components should also be initialized by this point. @@ -100,18 +96,20 @@ void AGasaGameState::BeginPlay() GI->NotifyGameFrameworkClassReady(EGameFrameworkClassFlag::GameState); #if ENABLE_COG - CogWindowManager = NewObject(this); - CogWindowManagerRef = CogWindowManager; + for (local_persist int32 do_once = 0; do_once == 0; ++ do_once ) + { + CogWindowManager = NewObject(this); + CogWindowManagerRef = CogWindowManager; - // Add all the built-in windows - Cog::AddAllWindows(*CogWindowManager); + // Add all the built-in windows + Cog::AddAllWindows(*CogWindowManager); + } #endif //ENABLE_COG } void AGasaGameState::PostInitializeComponents() { NetLog("PostInitializeComponents"); - Super::PostInitializeComponents(); if ( ! GetWorld()->IsEditorWorld() && IsServer()) @@ -135,7 +133,8 @@ void AGasaGameState::Tick(float DeltaSeconds) Super::Tick(DeltaSeconds); #if ENABLE_COG - CogWindowManager->Tick(DeltaSeconds); + if (CogWindowManager) + CogWindowManager->Tick(DeltaSeconds); #endif //ENABLE_COG } #pragma endregion Actor diff --git a/Project/Source/Gasa/Game/GasaLevelScriptActor.h b/Project/Source/Gasa/Game/GasaLevelScriptActor.h index 0272d12..1d6c284 100644 --- a/Project/Source/Gasa/Game/GasaLevelScriptActor.h +++ b/Project/Source/Gasa/Game/GasaLevelScriptActor.h @@ -52,7 +52,7 @@ public: #pragma region Actor void BeginPlay() override; -#pragma region endActor +#pragma endregion endActor }; namespace Gasa