UnrealImGui/Source/ImGui/Private/Utilities/WorldContext.cpp
Sebastian d4ffe9443f Enforced IWYU-style PCH model:
- Removed explicit PCH.
- Fixed includes to compile for all supported engine versions, including non-unity builds.
- Configured build.cs to treat ImGui as an engine module and added stricter compilation rules.
2020-06-25 10:52:46 +01:00

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;
}
}