MCPcopy Create free account
hub / github.com/arnaud-jamin/Cog / GetInstigator

Method GetInstigator

Source/CogSample/CogSampleFunctionLibrary_Gameplay.cpp:325–348  ·  view source on GitHub ↗

--------------------------------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

323
324//--------------------------------------------------------------------------------------------------------------------------
325AActor* UCogSampleFunctionLibrary_Gameplay::GetInstigator(const AActor* Actor)
326{
327 if (Actor == nullptr)
328 {
329 return nullptr;
330 }
331
332 AActor* Instigator = Actor->GetInstigator();
333 if (Instigator != nullptr)
334 {
335 return Instigator;
336 }
337
338 //-------------------------------------------------
339 // The game state is the default Instigator
340 //-------------------------------------------------
341 UWorld* World = Actor->GetWorld();
342 if (World != nullptr)
343 {
344 return World->GetGameState();
345 }
346
347 return nullptr;
348}
349
350//--------------------------------------------------------------------------------------------------------------------------
351int32 UCogSampleFunctionLibrary_Gameplay::GetProgressionLevel(const AActor* Actor)

Callers 4

OnGameplayEffectAddedMethod · 0.80
BeginPlayMethod · 0.80
EndPlayMethod · 0.80

Calls 1

GetWorldMethod · 0.80

Tested by

no test coverage detected