mirror of
https://github.com/kevinporetti/UnrealImGui.git
synced 2025-01-19 08:50:31 +00:00
23 lines
483 B
C++
23 lines
483 B
C++
|
// Distributed under the MIT License (MIT) (see accompanying LICENSE file)
|
||
|
|
||
|
#include "WorldContext.h"
|
||
|
|
||
|
|
||
|
namespace Utilities
|
||
|
{
|
||
|
const FWorldContext* GetWorldContextFromNetMode(ENetMode NetMode)
|
||
|
{
|
||
|
checkf(GEngine, TEXT("GEngine required to get list of worlds."));
|
||
|
|
||
|
for (const FWorldContext& WorldContext : GEngine->GetWorldContexts())
|
||
|
{
|
||
|
if (WorldContext.World() && WorldContext.World()->GetNetMode() == NetMode)
|
||
|
{
|
||
|
return &WorldContext;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return nullptr;
|
||
|
}
|
||
|
}
|