diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-14 09:02:23 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-14 09:02:23 +0300 |
| commit | d4c2ee22771b20208ee07ec38d868c3b0ce963bf (patch) | |
| tree | 2ccf2da527dd9e664d3f2ab541e852ded8474e2d /crates/fparkan-runtime/src/unit_patrol.rs | |
| parent | 176b377c8d4406161ff206a8cb5ac8c8359877cf (diff) | |
| download | fparkan-d4c2ee22771b20208ee07ec38d868c3b0ce963bf.tar.xz fparkan-d4c2ee22771b20208ee07ec38d868c3b0ce963bf.zip | |
feat(runtime): replenish AutoDemo clans after combat losses
Diffstat (limited to 'crates/fparkan-runtime/src/unit_patrol.rs')
| -rw-r--r-- | crates/fparkan-runtime/src/unit_patrol.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/fparkan-runtime/src/unit_patrol.rs b/crates/fparkan-runtime/src/unit_patrol.rs index 15a356c9..be0d0a35 100644 --- a/crates/fparkan-runtime/src/unit_patrol.rs +++ b/crates/fparkan-runtime/src/unit_patrol.rs @@ -28,6 +28,17 @@ pub(super) struct PreparedPatrol { } impl UnitPatrol { + pub(super) fn activate(&mut self, world: &World, handle: ObjectHandle) { + self.units + .retain(|unit| transform_state(world, unit.handle).is_ok()); + self.units.push(PatrollingUnit { + handle, + points: VecDeque::new(), + retry_ms: 0, + attack: None, + }); + } + pub(super) fn new( mission: &MissionDocument, drafts: &[MissionObjectDraft], |
