Hello
I started receiving warning message when I build project:
\Battleships\BaseBattleship.cpp(351): warning C4996: ‘AActor::GetComponentsByClass’: Use one of the GetComponents implementations as appropriate Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile.
2> C:\Program Files\Epic Games\UE_4.24\Engine\Source\Runtime\Engine\Classes\GameFramework/Actor.h(2881): note: see declaration of ‘AActor::GetComponentsByClass’
And in line 351 I have:
for (auto ActorComponent : GetComponentsByClass(UOffensiveAttachmentComponent::StaticClass()))
inside of function: TArray ABaseBattleship::GetOffensiveModulesAttachmentComponents() const { TArray<UOffensiveAttachmentComponent*> ComponentsArray; for (auto ActorComponent : GetComponentsByClass(UOffensiveAttachmentComponent::StaticClass())) { if (auto OffensiveSceneComponent = Cast<UOffensiveAttachmentComponent>(ActorComponent)) { ComponentsArray.Add(OffensiveSceneComponent); } } return ComponentsArray; }
I found similar case: https://forums.unrealengine.com/development-discussion/c-gameplay-programming/1699015-4-24-c-transition-guide
But it dont clear for me what to do.
Help me please(