Skip to content

Crash because of World not valid when using level streamings #10

@mado-xr

Description

@mado-xr

I used the ocean project in a level and wanted to switch to another scene which doesn't have the ocean in it so I put both scenes in a level and switched the level visibility.
However when I switch from the level who has the ocean to the level who doesn't have the ocean it crashes because the world is not valid.

Here is the fix I made:
InifiniteSystemComponent.cpp
Added in line 109:

	//Prevents crash if world not existing (in streaming level transition)
	if (World == nullptr) return;

OceanManager.cpp
Added in line 40:
if (World == nullptr) return 0.1f;

WeatherDataPlugin.cpp
Added in line 29:

	// Check if World is valid first
	if (!World) return;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions