aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/unit_spawn.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/fparkan-runtime/src/unit_spawn.rs')
-rw-r--r--crates/fparkan-runtime/src/unit_spawn.rs7
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));