Skip to content

Commit

Permalink
fix last
Browse files Browse the repository at this point in the history
  • Loading branch information
toasterparty committed Feb 3, 2024
1 parent 818e7b5 commit c3f32ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 7 additions & 0 deletions schema/randomprime.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2910,6 +2910,13 @@
"minimum": 0,
"maximum": 16777215
},
"layer": {
"description": "Layer",
"type": "integer",
"default": 0,
"minimum": 0,
"maximum": 63
},
"position": {
"description": "Position of the scan point.",
"$ref": "#/$defs/vector3"
Expand Down
8 changes: 5 additions & 3 deletions src/patches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3417,12 +3417,14 @@ fn patch_add_scan_actor<'r>(
game_resources: &HashMap<(u32, FourCC), structs::Resource<'r>>,
position: [f32;3],
rotation: f32,
layer: Option<u32>,
)
-> Result<(), String>
{
let instance_id = area.new_object_id_from_layer_name("Default");
let layer = layer.unwrap_or(0) as usize;
let instance_id = area.new_object_id_from_layer_id(layer);
let scly = area.mrea().scly_section_mut();
scly.layers.as_mut_vec()[0].objects.as_mut_vec().push(
scly.layers.as_mut_vec()[layer].objects.as_mut_vec().push(
structs::SclyObject {
instance_id: instance_id,
connections: vec![].into(),
Expand Down Expand Up @@ -16008,7 +16010,7 @@ fn build_and_run_patches<'r>(gc_disc: &mut structs::GcDisc<'r>, config: &PatchCo
if scan.combat_visible.unwrap_or(false) {
patcher.add_scly_patch(
(pak_name.as_bytes(), room_info.room_id.to_u32()),
move |ps, area| patch_add_scan_actor(ps, area, game_resources, scan.position, scan.rotation.unwrap_or(0.0)),
move |ps, area| patch_add_scan_actor(ps, area, game_resources, scan.position, scan.rotation.unwrap_or(0.0), scan.layer),
);
}

Expand Down

0 comments on commit c3f32ed

Please sign in to comment.