Skip to content

Commit

Permalink
AirBlueprintLib: fix compile error
Browse files Browse the repository at this point in the history
- explicit template declaration must be after the GetActorComponent
  method definition
- GCC failed to induce the template type of FindAllActor, so make it
  explicit
  • Loading branch information
bkueng committed Feb 21, 2017
1 parent 11cc1a6 commit 4c9fe69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 5 additions & 1 deletion Unreal/Plugins/AirSim/Source/AirBlueprintLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,16 @@ T* UAirBlueprintLib::GetActorComponent(AActor* actor, FString name)
}
return found;
}
template UChildActorComponent* UAirBlueprintLib::GetActorComponent(AActor*, FString);
template USceneCaptureComponent2D* UAirBlueprintLib::GetActorComponent(AActor*, FString);
template UStaticMeshComponent* UAirBlueprintLib::GetActorComponent(AActor*, FString);
template URotatingMovementComponent* UAirBlueprintLib::GetActorComponent(AActor*, FString);

template<typename T>
T* UAirBlueprintLib::FindActor(const UObject* context, FString name)
{
TArray<AActor*> foundActors;
FindAllActor(context, foundActors);
FindAllActor<T>(context, foundActors);

for (AActor* actor : foundActors) {
if (actor->GetName().Compare(name) == 0) {
Expand Down
4 changes: 0 additions & 4 deletions Unreal/Plugins/AirSim/Source/AirBlueprintLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,3 @@ class UAirBlueprintLib : public UBlueprintFunctionLibrary
typename FInputActionHandlerSignature::TUObjectMethodDelegate< UserClass >::FMethodPtr func);
};

template UChildActorComponent* UAirBlueprintLib::GetActorComponent(AActor*, FString);
template USceneCaptureComponent2D* UAirBlueprintLib::GetActorComponent(AActor*, FString);
template UStaticMeshComponent* UAirBlueprintLib::GetActorComponent(AActor*, FString);
template URotatingMovementComponent* UAirBlueprintLib::GetActorComponent(AActor*, FString);

0 comments on commit 4c9fe69

Please sign in to comment.