Skip to content

Commit

Permalink
Reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
slonopotamus committed Aug 6, 2024
1 parent 9764a06 commit 86f6fcd
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions Source/UEST/Private/ScopedGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
struct TGWorldGuard final : FNoncopyable
{
TGWorldGuard()
: OldWorld{GWorld}
: OldWorld{GWorld}
{
}

Expand All @@ -25,8 +25,8 @@ struct TGWorldGuard final : FNoncopyable
struct FCVarGuard final : FNoncopyable
{
explicit FCVarGuard(IConsoleVariable* Variable, const FScopedGameInstance::FCVarConfig& CVarConfig)
: Variable{Variable}
, OldValue{Variable ? Variable->GetString() : TEXT("")}
: Variable{Variable}
, OldValue{Variable ? Variable->GetString() : TEXT("")}
{
if (Variable || CVarConfig.bEnsureIfVariableNotFound && ensureAlways(Variable))
{
Expand Down Expand Up @@ -57,9 +57,9 @@ static int32 NumScopedGames = 0;
static TUniquePtr<FCVarsGuard> CVarsGuard;

FScopedGameInstance::FScopedGameInstance(TSubclassOf<UGameInstance> GameInstanceClass, const bool bGarbageCollectOnDestroy, const TMap<FString, FCVarConfig>& CVars)
: GameInstanceClass{MoveTemp(GameInstanceClass)}
, LastInstanceId{0}
, bGarbageCollectOnDestroy{bGarbageCollectOnDestroy}
: GameInstanceClass{MoveTemp(GameInstanceClass)}
, LastInstanceId{0}
, bGarbageCollectOnDestroy{bGarbageCollectOnDestroy}
{
if (NumScopedGames == 0)
{
Expand All @@ -75,10 +75,10 @@ FScopedGameInstance::FScopedGameInstance(TSubclassOf<UGameInstance> GameInstance
}

FScopedGameInstance::FScopedGameInstance(FScopedGameInstance&& Other)
: GameInstanceClass{MoveTemp(Other.GameInstanceClass)}
, Games{MoveTemp(Other.Games)}
, LastInstanceId{Other.LastInstanceId}
, bGarbageCollectOnDestroy{Other.bGarbageCollectOnDestroy}
: GameInstanceClass{MoveTemp(Other.GameInstanceClass)}
, Games{MoveTemp(Other.Games)}
, LastInstanceId{Other.LastInstanceId}
, bGarbageCollectOnDestroy{Other.bGarbageCollectOnDestroy}
{
++NumScopedGames;
}
Expand Down Expand Up @@ -145,7 +145,7 @@ UGameInstance* FScopedGameInstance::CreateGame(const EScopedGameType Type, const
const auto BrowseResult = Game->GetEngine()->Browse(*WorldContext, URL, Error);
if (BrowseResult == EBrowseReturnVal::Pending)
{
if (bWaitForConnect && !TickUntil([&]
const auto WaitForConnect = [&]
{
if (Game->GetWorldContext()->PendingNetGame)
{
Expand Down Expand Up @@ -187,7 +187,9 @@ UGameInstance* FScopedGameInstance::CreateGame(const EScopedGameType Type, const
}

return true;
}))
};

if (bWaitForConnect && !TickUntil(WaitForConnect))
{
ensureAlwaysMsgf(false, TEXT("Timeout connecting to dedicated server"));
DestroyGame(Game);
Expand Down

0 comments on commit 86f6fcd

Please sign in to comment.