mirror of
https://github.com/sinbad/StevesUEHelpers.git
synced 2025-02-23 17:45:23 +00:00
Even more safety
This commit is contained in:
parent
38d126ac64
commit
4c22341052
@ -20,10 +20,11 @@ public:
|
|||||||
|
|
||||||
inline UStevesGameSubsystem* GetStevesGameSubsystem(UWorld* WorldContext)
|
inline UStevesGameSubsystem* GetStevesGameSubsystem(UWorld* WorldContext)
|
||||||
{
|
{
|
||||||
if (IsValid(WorldContext) && IsValid(WorldContext->GetGameInstance()) &&
|
if (IsValid(WorldContext) && WorldContext->IsGameWorld())
|
||||||
WorldContext->IsGameWorld())
|
|
||||||
{
|
{
|
||||||
return WorldContext->GetGameInstance()->GetSubsystem<UStevesGameSubsystem>();
|
auto GI = WorldContext->GetGameInstance();
|
||||||
|
if (IsValid(GI))
|
||||||
|
return GI->GetSubsystem<UStevesGameSubsystem>();
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user