From 39b16e379fb679aa56ded8ab5463569e5633a656 Mon Sep 17 00:00:00 2001 From: tom barrett Date: Mon, 25 Jun 2018 08:36:57 -0500 Subject: added item mass, allow stopping of ship, if storage is full item goes into space --- src/server/mining.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/mining.rs b/src/server/mining.rs index a54ce33..3cf5f0b 100644 --- a/src/server/mining.rs +++ b/src/server/mining.rs @@ -56,7 +56,13 @@ impl ServerConnection { } match item { - Some(item) => ship.give(item), + Some(item) => match ship.give(item.clone()) { + false => { + let mass = Mass::new_item(item.clone(), ship.position, ship.velocity); + masses.insert(item.name.clone(), mass); + } + true => (), + } None => (), } @@ -84,7 +90,6 @@ impl ServerConnection { } _ => (), } - false } } -- cgit v1.2.3