From c618d9936e4e639146ff0676d11cc122b2e2254e Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 21 Jul 2024 15:51:38 +0200 Subject: customers return to chair when moved, improve line --- server/src/entity/customers/demands.rs | 10 +++++----- server/src/entity/customers/mod.rs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'server/src') diff --git a/server/src/entity/customers/demands.rs b/server/src/entity/customers/demands.rs index 4f15f86f..33557b50 100644 --- a/server/src/entity/customers/demands.rs +++ b/server/src/entity/customers/demands.rs @@ -80,11 +80,11 @@ pub fn generate_demands( .iter() .filter_map(|(i, o, d)| { producable.get(i).map(|cost| Demand { - from: *i, - to: *o, - duration: *d, - points: *cost as i64, - }) + from: *i, + to: *o, + duration: *d, + points: *cost as i64, + }) }) .collect() } diff --git a/server/src/entity/customers/mod.rs b/server/src/entity/customers/mod.rs index 974ae686..06f99686 100644 --- a/server/src/entity/customers/mod.rs +++ b/server/src/entity/customers/mod.rs @@ -127,7 +127,7 @@ impl EntityT for Customers { demand, timeout, } => { - player.direction *= 0.; + player.direction = (chair.as_vec2() + 0.5) - player.position(); *timeout -= dt; if *timeout <= 0. { self.cpackets.push_back(( @@ -213,7 +213,7 @@ impl EntityT for Customers { progress, chair, } => { - player.direction *= 0.; + player.direction = (chair.as_vec2() + 0.5) - player.position(); let demand = &self.demands[demand.0]; *progress += dt / demand.duration; if *progress >= 1. { -- cgit v1.2.3-70-g09d2