Partially revert "Fix additive scenes applying their NavMesh properties" (#3643)

Apply navmesh overrides from additive scenes, only ignore overrides from system scenes.

For some reason our startup scenes load as additive, so the navmesh settings of the startup scene would have been ignored.

Partially reverts https://github.com/Facepunch/sbox/pull/3555

We could also fully revert it if we want system scenes to be able to override navmesh settings.
This commit is contained in:
Lorenz Junglas
2025-12-18 20:41:36 +01:00
committed by GitHub
parent d5daad537b
commit 3be8514e6d

View File

@@ -101,7 +101,7 @@ public partial class Scene : GameObject
if ( sceneFile.SceneProperties is not null ) if ( sceneFile.SceneProperties is not null )
{ {
DeserializeProperties( sceneFile.SceneProperties, options.IsAdditive ); DeserializeProperties( sceneFile.SceneProperties, options.IsSystemScene );
} }
// //
@@ -255,7 +255,7 @@ public partial class Scene : GameObject
return metadata; return metadata;
} }
void DeserializeProperties( JsonObject data, bool isAdditive = false ) void DeserializeProperties( JsonObject data, bool isSystemScene = false )
{ {
var sceneType = Game.TypeLibrary.GetType<Scene>(); var sceneType = Game.TypeLibrary.GetType<Scene>();
Assert.NotNull( sceneType, "Scene type is inaccessible!" ); Assert.NotNull( sceneType, "Scene type is inaccessible!" );
@@ -280,9 +280,9 @@ public partial class Scene : GameObject
} }
// //
// We don't want navmesh to be overwritten in additive loads // We don't want navmesh to be overwritten by system scene loads
// //
if ( !isAdditive ) if ( !isSystemScene )
{ {
NavMesh.Deserialize( data["NavMesh"] as JsonObject ); NavMesh.Deserialize( data["NavMesh"] as JsonObject );
} }