Cheat command fallback to PIE 1 actor selection

This commit is contained in:
Arnaud Jamin
2025-05-14 15:21:44 -04:00
parent 13caff8dbe
commit 539a4ba9e8
3 changed files with 12 additions and 3 deletions
@@ -15,8 +15,16 @@ FCogDebugSettings FCogDebug::Settings = FCogDebugSettings();
//--------------------------------------------------------------------------------------------------------------------------
FCogDebugContext& FCogDebug::Get(const int32 InPieId)
{
if (InPieId == INDEX_NONE)
{
if (FCogDebugContext* Context = DebugContexts.Find(1))
{
return *Context;
}
}
FCogDebugContext& Context = DebugContexts.FindOrAdd(InPieId);
return Context;
return Context;
}
//--------------------------------------------------------------------------------------------------------------------------
@@ -72,7 +72,7 @@ struct COGDEBUG_API FCogDebug
static void GetDebugDrawSweepSettings(FCogDebugDrawSweepParams& Params);
static FCogDebugContext& Get(int32 InPieId);
static FCogDebugContext& Get();
static int32 GetPieSessionId();
@@ -62,7 +62,8 @@ void FCogEngineWindow_Cheats::Initialize()
const bool ApplyToAllies = InArgs.Contains("-Allies");
const bool ApplyToControlled = InArgs.Contains("-Controlled");
RequestCheat(*Replicator, GetLocalPlayerPawn(), GetSelection(), *Cheat, ApplyToEnemies, ApplyToAllies, ApplyToControlled);
AActor* Selection = GetSelection();
RequestCheat(*Replicator, GetLocalPlayerPawn(), Selection, *Cheat, ApplyToEnemies, ApplyToAllies, ApplyToControlled);
}
}));