diff --git a/schema/randomprime.schema.json b/schema/randomprime.schema.json index 12c7dd74..4eb25fb6 100644 --- a/schema/randomprime.schema.json +++ b/schema/randomprime.schema.json @@ -3006,6 +3006,11 @@ "layer": { "$ref": "#/$defs/addModifyLayer" }, + "active": { + "description": "Default active state of the platform.", + "type": "boolean", + "default": true + }, "position": { "description": "The position of the platform.", "$ref": "#/$defs/vector3" diff --git a/src/add_modify_obj_patches.rs b/src/add_modify_obj_patches.rs index 3c8cb7fa..880e6582 100644 --- a/src/add_modify_obj_patches.rs +++ b/src/add_modify_obj_patches.rs @@ -1491,7 +1491,7 @@ pub fn patch_add_platform<'r>( asset_type: FourCC::from_bytes(fourcc), } ); - area.add_dependencies(game_resources,0,deps_iter); + area.add_dependencies(game_resources,0, deps_iter); macro_rules! new { () => { @@ -1551,7 +1551,7 @@ pub fn patch_add_platform<'r>( }, speed: 5.0, - active: 1, + active: config.active.unwrap_or(true) as u8, dcln: dcln, @@ -1584,6 +1584,10 @@ pub fn patch_add_platform<'r>( if let Some(rotation) = config.rotation { property_data.rotation = rotation.into(); } + + if let Some(active) = config.active { + property_data.active = active as u8; + } }; } diff --git a/src/patch_config.rs b/src/patch_config.rs index 4a469388..3b4042b2 100644 --- a/src/patch_config.rs +++ b/src/patch_config.rs @@ -219,6 +219,7 @@ pub struct PlatformConfig { pub id: Option, pub layer: Option, + pub active: Option, pub position: [f32;3], pub rotation: Option<[f32;3]>, pub alt_platform: Option, // deprecated diff --git a/src/patches.rs b/src/patches.rs index 67672e5c..abf90f83 100644 --- a/src/patches.rs +++ b/src/patches.rs @@ -16850,6 +16850,7 @@ fn build_and_run_patches<'r>(gc_disc: &mut structs::GcDisc<'r>, config: &PatchCo xray_only: None, thermal_only: None, layer: None, + active: None, }, ), ); @@ -16868,6 +16869,7 @@ fn build_and_run_patches<'r>(gc_disc: &mut structs::GcDisc<'r>, config: &PatchCo xray_only: None, thermal_only: None, layer: None, + active: None, }, ), ); @@ -16886,6 +16888,7 @@ fn build_and_run_patches<'r>(gc_disc: &mut structs::GcDisc<'r>, config: &PatchCo xray_only: None, thermal_only: None, layer: None, + active: None, }, ), ); @@ -16904,6 +16907,7 @@ fn build_and_run_patches<'r>(gc_disc: &mut structs::GcDisc<'r>, config: &PatchCo xray_only: None, thermal_only: None, layer: None, + active: None, }, ), );