Skip to content

Commit

Permalink
Fix not running commands in editor
Browse files Browse the repository at this point in the history
  • Loading branch information
András Borbás committed Jan 31, 2023
1 parent 192f619 commit 430d056
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion QuickCommands.uplugin
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "5.1.0",
"VersionName": "5.1.1",
"FriendlyName": "QuickCommands",
"Description": "Clickable commands",
"Category": "Editor",
Expand Down
6 changes: 5 additions & 1 deletion Source/QuickCommands/Private/QuickCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,14 @@ void FQuickCommandsModule::CreateCommandList(TSharedRef<SScrollBox> ButtonList,
{
TargetPC->ConsoleCommand(*sCommand, true);
}
else
{
GEngine->Exec(World, *sCommand, *GLog);
}
}
else
{
GEngine->Exec(GEngine->GetWorldContexts().Last().World(), *sCommand, *GLog);
UE_LOG(LogTemp, Error, TEXT("Could not run command because there was no world!"));
}
return FReply::Handled();
})]];
Expand Down

0 comments on commit 430d056

Please sign in to comment.