From 9ab4d74c905e383c807153f316695993eaddf761 Mon Sep 17 00:00:00 2001
From: jehret <ehret@vr.rwth-aachen.de>
Date: Sat, 1 Jul 2023 20:45:23 +0200
Subject: [PATCH] do not keep on opening error windows, but just do it once

---
 .../Private/SoundSource/VAAbstractSourceComponent.cpp       | 6 +++++-
 .../VAPlugin/Public/SoundSource/VAAbstractSourceComponent.h | 1 +
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/Source/VAPlugin/Private/SoundSource/VAAbstractSourceComponent.cpp b/Source/VAPlugin/Private/SoundSource/VAAbstractSourceComponent.cpp
index a85a86d..fc32c51 100644
--- a/Source/VAPlugin/Private/SoundSource/VAAbstractSourceComponent.cpp
+++ b/Source/VAPlugin/Private/SoundSource/VAAbstractSourceComponent.cpp
@@ -60,7 +60,11 @@ void UVAAbstractSourceComponent::TickComponent(const float DeltaTime, const ELev
 
 	if (!bInitialized)
 	{
-	    FVAUtils::OpenMessageBox("[UVASourceComponent::TickComponent()]: Sound source is not initialized", true);
+		if(!bInformedNotInitialized)
+		{
+			FVAUtils::OpenMessageBox("[UVASourceComponent::TickComponent()]: Sound source is not initialized", true);
+			bInformedNotInitialized = true;
+		}
 		return;
 	}
 
diff --git a/Source/VAPlugin/Public/SoundSource/VAAbstractSourceComponent.h b/Source/VAPlugin/Public/SoundSource/VAAbstractSourceComponent.h
index fdc43f4..aeaca2e 100644
--- a/Source/VAPlugin/Public/SoundSource/VAAbstractSourceComponent.h
+++ b/Source/VAPlugin/Public/SoundSource/VAAbstractSourceComponent.h
@@ -198,6 +198,7 @@ protected:
 	// Class data
 	bool bFirstTick = true;
 	bool bInitialized = false;
+	bool bInformedNotInitialized = false;
 	float TimeSinceUpdate;
 	bool ShouldSendCommand() const;
 	float Timer;
-- 
GitLab