mirror of
https://github.com/Facepunch/sbox-public.git
synced 2025-12-23 14:38:13 -05:00
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:
@@ -101,7 +101,7 @@ public partial class Scene : GameObject
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
void DeserializeProperties( JsonObject data, bool isAdditive = false )
|
||||
void DeserializeProperties( JsonObject data, bool isSystemScene = false )
|
||||
{
|
||||
var sceneType = Game.TypeLibrary.GetType<Scene>();
|
||||
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 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user