diff --git a/CustomImplementations/Buildables/FGBuildable.cpp b/CustomImplementations/Buildables/FGBuildable.cpp index e6892b9c..5ffde8ec 100644 --- a/CustomImplementations/Buildables/FGBuildable.cpp +++ b/CustomImplementations/Buildables/FGBuildable.cpp @@ -26,9 +26,13 @@ void AFGBuildable::OnConstruction(const FTransform& transform) { Super::OnConstruction(transform); #if WITH_EDITOR - RemoveInstances(); - RemoveInstances_Native(); - CallSetupInstances(); + const UWorld* World = GetWorld(); + if (IsValid(World) and World->IsGameWorld()) { + // Don't do this for non-game worlds, otherwise the editor crashes when compiling a blueprint + RemoveInstances(); + RemoveInstances_Native(); + CallSetupInstances(); + } #endif } TArray AFGBuildable::GetActorLightweightInstanceData_Implementation() {