From bdf95d04bcc7a962cd8d1c1900440b47a55940bf Mon Sep 17 00:00:00 2001 From: Panakotta00 Date: Sat, 26 Oct 2024 15:48:47 +0200 Subject: [PATCH] fix: some compile issues --- Source/FicsItLogLibrary/Private/FILLogContainer.cpp | 7 ++++++- Source/FicsItLogLibrary/Public/FILLogContainer.h | 4 ++-- Source/FicsItNetworksComputer/Private/FINComputerCase.cpp | 2 -- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/FicsItLogLibrary/Private/FILLogContainer.cpp b/Source/FicsItLogLibrary/Private/FILLogContainer.cpp index bc10c873e..b15611e2e 100644 --- a/Source/FicsItLogLibrary/Private/FILLogContainer.cpp +++ b/Source/FicsItLogLibrary/Private/FILLogContainer.cpp @@ -5,6 +5,7 @@ UFILLogContainer::UFILLogContainer() { SetIsReplicatedByDefault(true); + PrimaryComponentTick.bStartWithTickEnabled = true; } void UFILLogContainer::BeginPlay() { @@ -15,7 +16,11 @@ void UFILLogContainer::BeginPlay() { } } -void UFILLogContainer::Tick() { +void UFILLogContainer::TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) { + Super::TickComponent(DeltaTime, TickType, ThisTickFunction); + + if (!GetOwner()->HasAuthority()) return; + FScopeLock ScopeLock(&LogEntriesToAddMutex); if (!LogEntriesToAdd.IsEmpty()) { TArray Chunk(LogEntriesToAdd.GetData(), FMath::Min(10, LogEntriesToAdd.Num())); diff --git a/Source/FicsItLogLibrary/Public/FILLogContainer.h b/Source/FicsItLogLibrary/Public/FILLogContainer.h index 8e495f190..873b6e110 100644 --- a/Source/FicsItLogLibrary/Public/FILLogContainer.h +++ b/Source/FicsItLogLibrary/Public/FILLogContainer.h @@ -3,6 +3,7 @@ #include "CoreMinimal.h" #include "FILLogEntry.h" #include "FGSaveInterface.h" +#include "Components/ActorComponent.h" #include "FILLogContainer.generated.h" @@ -22,8 +23,7 @@ class FICSITLOGLIBRARY_API UFILLogContainer : public UActorComponent, public IFG virtual bool ShouldSave_Implementation() const override { return true; } // End IFGSaveInterface - UFUNCTION() - void Tick(); + virtual void TickComponent(float DeltaTime, enum ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override; UFUNCTION(BlueprintCallable) void PushLogEntry(TEnumAsByte Verbosity, const FString& Content); diff --git a/Source/FicsItNetworksComputer/Private/FINComputerCase.cpp b/Source/FicsItNetworksComputer/Private/FINComputerCase.cpp index 434d6a269..2f619af9e 100644 --- a/Source/FicsItNetworksComputer/Private/FINComputerCase.cpp +++ b/Source/FicsItNetworksComputer/Private/FINComputerCase.cpp @@ -149,8 +149,6 @@ void AFINComputerCase::TickActor(float DeltaTime, ELevelTick TickType, FActorTic Super::TickActor(DeltaTime, TickType, ThisTickFunction); if (HasAuthority()) { - Log->Tick(); - if (Kernel) { Kernel->HandleFutures(); if (Kernel->GetState() != InternalKernelState) {