summaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
authortom barrett <spalf0@gmail.com>2018-06-25 08:36:57 -0500
committertom barrett <spalf0@gmail.com>2018-06-25 08:36:57 -0500
commit39b16e379fb679aa56ded8ab5463569e5633a656 (patch)
tree446c1f2e609836c61109aa27400ac4bf2155c7dc /src/server
parent7094849bf164ff6f853c8f6812a0e831a66762f3 (diff)
added item mass, allow stopping of ship, if storage is full item goes into space
Diffstat (limited to 'src/server')
-rw-r--r--src/server/mining.rs9
1 files changed, 7 insertions, 2 deletions
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
}
}