diff options
author | metamuffin <metamuffin@disroot.org> | 2024-07-21 15:51:38 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-07-21 15:51:51 +0200 |
commit | c618d9936e4e639146ff0676d11cc122b2e2254e (patch) | |
tree | d97313e8aec94b62650173a6c1b5c828d01b293b /server/src | |
parent | ebc7eb5fe1f53964b7ae7aa58231e220e9cacd68 (diff) | |
download | hurrycurry-c618d9936e4e639146ff0676d11cc122b2e2254e.tar hurrycurry-c618d9936e4e639146ff0676d11cc122b2e2254e.tar.bz2 hurrycurry-c618d9936e4e639146ff0676d11cc122b2e2254e.tar.zst |
customers return to chair when moved, improve line
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/entity/customers/demands.rs | 10 | ||||
-rw-r--r-- | server/src/entity/customers/mod.rs | 4 |
2 files changed, 7 insertions, 7 deletions
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. { |