Hi,
I am getting a crash on startup to do with binding commands for showing / hiding volume types
The crash is in SLevelViewport.cpp BindShowCommands:
for( int32 VolumeClassIndex = 0; VolumeClassIndex < VolumeClasses.Num(); ++VolumeClassIndex )
{
CommandList.MapAction(
FLevelViewportCommands::Get().ShowVolumeCommands[ VolumeClassIndex ].ShowMenuItem,
FExecuteAction::CreateSP( this, &SLevelViewport::ToggleShowVolumeClass, VolumeClassIndex ),
FCanExecuteAction(),
FIsActionChecked::CreateSP( this, &SLevelViewport::IsVolumeVisible, VolumeClassIndex ) );
}
With an index out of bounds accessing ShowVolumeCommands. The VolumeClasses array is larger than the ShowVolumeCommands array.
The reason for this is in the LevelEditorModule::RegisterCommands function. This is only ever called once when the module is started, but if a plugin creates a new type of AVolume and is loaded after this module’s StartupModule is called, then calling UUnrealEdEngine::GetSortedVolumeClasses(&VolumeClasses); will return different results.
Currently, I see the FPaperLevelEditorMenuExtensions::InstallHooks() calling FModuleManager::Get().LoadModuleChecked(“LevelEditor”);
This is before the plugin (in this case Simplygon) that contains a new volume type is loaded. Is there some way to fix the loading order as a workaround?
Thanks,
Ben