aboutsummaryrefslogtreecommitdiff
path: root/crates/fparkan-runtime/src/boarding/remote_control.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/fparkan-runtime/src/boarding/remote_control.rs')
-rw-r--r--crates/fparkan-runtime/src/boarding/remote_control.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/crates/fparkan-runtime/src/boarding/remote_control.rs b/crates/fparkan-runtime/src/boarding/remote_control.rs
index ee030e2f..1a881a5d 100644
--- a/crates/fparkan-runtime/src/boarding/remote_control.rs
+++ b/crates/fparkan-runtime/src/boarding/remote_control.rs
@@ -1,6 +1,6 @@
//! The command-post link to a friendly warbot's cockpit.
-use super::{has_working_pilot_control, start_warbot_control};
+use super::{has_working_pilot_control, start_player_control};
use crate::{
component_cockpit,
strategic_roster::warbot_rows,
@@ -76,14 +76,19 @@ pub fn control_warbot_remotely(
{
patrol.release_orders_for_manual_control(target);
}
- start_warbot_control(engine, hero, cockpit, Some(mode));
+ start_player_control(engine, hero, cockpit, Some(mode), None);
Some(cockpit)
}
/// The active control mode of a warbot linked to the command post.
#[must_use]
pub fn remote_warbot_control(engine: &Engine) -> Option<RemoteWarbotControl> {
- engine.loaded.as_ref()?.boarding?.remote
+ let boarding = engine.loaded.as_ref()?.boarding?;
+ boarding
+ .turret
+ .is_none()
+ .then_some(boarding.remote)
+ .flatten()
}
/// The active autonomous weapons' ammunition, charge and firing phases.
@@ -100,7 +105,7 @@ pub fn remote_automatic_weapons(engine: &Engine) -> Option<&PlayerWeapons> {
}
#[cfg(test)]
-mod tests {
+pub(super) mod tests {
use super::*;
use crate::{
create, disembark_warbot, frame, frame_with_player_motion, load_gameplay_mission,
@@ -111,7 +116,7 @@ mod tests {
use fparkan_world::transform_state;
use std::sync::Arc;
- fn stock_fortresses() -> Engine {
+ pub(in crate::boarding) fn stock_fortresses() -> Engine {
let root = std::env::var_os("FPARKAN_CORPUS_PART1_ROOT").expect("licensed corpus");
let mut engine = create(EngineServices::new(Arc::new(DirectoryVfs::new(root)))).unwrap();
load_gameplay_mission(