diff options
Diffstat (limited to 'crates/fparkan-runtime/src/unit_spawn.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/unit_spawn.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/unit_spawn.rs b/crates/fparkan-runtime/src/unit_spawn.rs index 4fd9e31e..09345192 100644 --- a/crates/fparkan-runtime/src/unit_spawn.rs +++ b/crates/fparkan-runtime/src/unit_spawn.rs @@ -49,6 +49,13 @@ pub(super) fn spawn_prepared_unit( .behavior_control_groupings .retain(|group| transform_state(world, group.handle).is_ok()); table.handle = handle; + if let Some(profile) = mission + .behavior_profiles + .iter_mut() + .find(|profile| Some(profile.original_id) == draft.original_id) + { + profile.handle = handle; + } mission .behavior_control_groupings .push(crate::project_mission_behavior_control_grouping(&table)); |
