File tree Expand file tree Collapse file tree 1 file changed +13
-22
lines changed
Source/Immutable/Private/Immutable/Mac Expand file tree Collapse file tree 1 file changed +13
-22
lines changed Original file line number Diff line number Diff line change @@ -28,17 +28,24 @@ ASWebAuthenticationSession *_authSession;
28
28
}
29
29
30
30
+ (UImmutablePassport*) getPassport {
31
- UWorld* World = nullptr ;
32
-
33
31
#if WITH_EDITOR
34
32
if (GEditor)
35
33
{
36
34
for (const auto & Context : GEditor->GetWorldContexts ())
37
35
{
38
- if (Context. WorldType == EWorldType::PIE && Context.World ())
36
+ if (auto * World = Context.World ())
39
37
{
40
- World = Context.World ();
41
- break ;
38
+ if (auto GameInstance = World->GetGameInstance ())
39
+ {
40
+ if (auto ImmutableSubsystem = GameInstance->GetSubsystem <UImmutableSubsystem>())
41
+ {
42
+ auto WeakPassport = ImmutableSubsystem->GetPassport ();
43
+ if (auto Passport = WeakPassport.Get ())
44
+ {
45
+ return Passport;
46
+ }
47
+ }
48
+ }
42
49
}
43
50
}
44
51
}
@@ -49,23 +56,7 @@ ASWebAuthenticationSession *_authSession;
49
56
}
50
57
#endif
51
58
52
- if (!World) {
53
- return nil;
54
- }
55
-
56
- auto ImmutableSubsystem = World->GetGameInstance ()->GetSubsystem <UImmutableSubsystem>();
57
-
58
- if (!ImmutableSubsystem) {
59
- return nil;
60
- }
61
-
62
- auto Passport = ImmutableSubsystem->GetPassport ();
63
-
64
- if (!Passport.IsValid ()) {
65
- return nil;
66
- }
67
-
68
- return Passport.Get ();
59
+ return nil;
69
60
}
70
61
71
62
- (void )launchUrl:(const char *)url forRedirectUri:(const char *)redirectUri {
You can’t perform that action at this time.
0 commit comments