int32 APC_ReplaySpectator::GetCurrentReplayTotalTimeInSeconds() const
{
if (GetWorld())
{
if (GetWorld()->DemoNetDriver)
{
return GetWorld()->DemoNetDriver->DemoTotalTime;
}
}
return 0.f;
}
ERROR: pointer to incomplete class type is not allowed if (GetWorld()->DemoNetDriver)
Following instructions connect the following libraries: #include "TP_StrategyWithSteam.h" #include "Engine/DemoNetDriver.h" #include "PC_ReplaySpectator.h"
Thanks mate. ! I am going to be more active in forums so people are encouraged to post answers, so will I when I find something.
To add on to his answer, look into IWYU of UE4, from now on you have to add all the header files of classes you intend to use, this is to reduce compile time.
Right now, in the documentation says that we need to use this #include "Runtime/Engine/Classes/GameFramework/Actor.h" if we are handling an AActor, if we are handling an UWorld we have to use #include "Runtime/Engine/Classes/Engine/World.h".