From 92ead1cf38b7a35aca2b7cf8862e4b9b5feb0369 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Mon, 10 Apr 2023 20:58:08 +0100 Subject: [PATCH] Removed vehicle riders, for now --- common/src/event.rs | 1 - rtsim/src/data/npc.rs | 5 ----- rtsim/src/rule/simulate_npcs.rs | 1 - server/src/events/mod.rs | 3 +-- server/src/rtsim/tick.rs | 7 ------- 5 files changed, 1 insertion(+), 16 deletions(-) diff --git a/common/src/event.rs b/common/src/event.rs index 80d1c952a2..89c708b5e0 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -230,7 +230,6 @@ pub enum ServerEvent { ship: comp::ship::Body, rtsim_entity: Option, driver: Option, - passangers: Vec, }, CreateWaypoint(Vec3), ClientDisconnect(EcsEntity, DisconnectReason), diff --git a/rtsim/src/data/npc.rs b/rtsim/src/data/npc.rs index 9e01043373..b25f00a2f3 100644 --- a/rtsim/src/data/npc.rs +++ b/rtsim/src/data/npc.rs @@ -266,10 +266,6 @@ pub struct Vehicle { #[serde(skip)] pub driver: Option, - #[serde(skip)] - // TODO: Find a way to detect riders when the vehicle is loaded - pub riders: Vec, - /// Whether the Vehicle is in simulated or loaded mode (when rtsim is run on /// the server, loaded corresponds to being within a loaded chunk). When /// in loaded mode, the interactions of the Vehicle should not be @@ -285,7 +281,6 @@ impl Vehicle { body, chunk_pos: None, driver: None, - riders: Vec::new(), mode: SimulationMode::Simulated, } } diff --git a/rtsim/src/rule/simulate_npcs.rs b/rtsim/src/rule/simulate_npcs.rs index cdd25d1cca..41f70eab51 100644 --- a/rtsim/src/rule/simulate_npcs.rs +++ b/rtsim/src/rule/simulate_npcs.rs @@ -34,7 +34,6 @@ fn on_setup(ctx: EventCtx) { if let Some(ride) = &npc.riding { if let Some(vehicle) = data.npcs.vehicles.get_mut(ride.vehicle) { let actor = Actor::Npc(npc_id); - vehicle.riders.push(actor); if ride.steering && vehicle.driver.replace(actor).is_some() { error!("Replaced driver"); } diff --git a/server/src/events/mod.rs b/server/src/events/mod.rs index a3b23044d4..a6c4882257 100644 --- a/server/src/events/mod.rs +++ b/server/src/events/mod.rs @@ -196,8 +196,7 @@ impl Server { ship, rtsim_entity, driver, - passangers, - } => handle_create_ship(self, pos, ship, rtsim_entity, driver, passangers), + } => handle_create_ship(self, pos, ship, rtsim_entity, driver, Vec::new()), ServerEvent::CreateWaypoint(pos) => handle_create_waypoint(self, pos), ServerEvent::ClientDisconnect(entity, reason) => { frontend_events.push(handle_client_disconnect(self, entity, reason, false)) diff --git a/server/src/rtsim/tick.rs b/server/src/rtsim/tick.rs index 0bf9d55da6..66ada89749 100644 --- a/server/src/rtsim/tick.rs +++ b/server/src/rtsim/tick.rs @@ -326,13 +326,6 @@ impl<'a> System<'a> for Sys { // agent: None,//Some(Agent::from_body(&Body::Ship(ship))), rtsim_entity: Some(RtSimVehicle(vehicle_id)), driver: vehicle.driver.and_then(&mut actor_info), - passangers: vehicle - .riders - .iter() - .copied() - .filter(|actor| vehicle.driver != Some(*actor)) - .filter_map(actor_info) - .collect(), }); } }