mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-06 23:58:48 +00:00
CogEngine: Fix crash
This commit is contained in:
@@ -226,9 +226,10 @@ void ACogEngineReplicator::Server_DeleteActor_Implementation(AActor* Actor)
|
|||||||
void ACogEngineReplicator::Server_ApplyCheat_Implementation(const AActor* CheatInstigator, const TArray<AActor*>& Targets, const FCogEngineCheat& Cheat) const
|
void ACogEngineReplicator::Server_ApplyCheat_Implementation(const AActor* CheatInstigator, const TArray<AActor*>& Targets, const FCogEngineCheat& Cheat) const
|
||||||
{
|
{
|
||||||
if (Cheat.Execution == nullptr)
|
if (Cheat.Execution == nullptr)
|
||||||
{
|
{ return; }
|
||||||
return;
|
|
||||||
}
|
if (GetWorld() == nullptr)
|
||||||
|
{ return; }
|
||||||
|
|
||||||
Cheat.Execution->Execute(GetWorld(), CheatInstigator, Targets);
|
Cheat.Execution->Execute(GetWorld(), CheatInstigator, Targets);
|
||||||
}
|
}
|
||||||
@@ -236,6 +237,9 @@ void ACogEngineReplicator::Server_ApplyCheat_Implementation(const AActor* CheatI
|
|||||||
//--------------------------------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------------------------------
|
||||||
ECogEngineCheat_ActiveState ACogEngineReplicator::IsCheatActiveOnTargets(const TArray<AActor*>& Targets, const FCogEngineCheat& Cheat) const
|
ECogEngineCheat_ActiveState ACogEngineReplicator::IsCheatActiveOnTargets(const TArray<AActor*>& Targets, const FCogEngineCheat& Cheat) const
|
||||||
{
|
{
|
||||||
|
if (GetWorld() == nullptr)
|
||||||
|
{ return ECogEngineCheat_ActiveState::Inactive; }
|
||||||
|
|
||||||
if (Cheat.Execution == nullptr)
|
if (Cheat.Execution == nullptr)
|
||||||
{
|
{
|
||||||
return ECogEngineCheat_ActiveState::Inactive;
|
return ECogEngineCheat_ActiveState::Inactive;
|
||||||
|
|||||||
@@ -190,6 +190,7 @@ void FCogEngineWindow_Cheats::RenderContent()
|
|||||||
if (Replicator == nullptr)
|
if (Replicator == nullptr)
|
||||||
{
|
{
|
||||||
ImGui::TextDisabled("No Replicator");
|
ImGui::TextDisabled("No Replicator");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ImGui::BeginMenuBar())
|
if (ImGui::BeginMenuBar())
|
||||||
|
|||||||
Reference in New Issue
Block a user