Browse Source

Change type, again

new_protocol
ThePerkinrex 5 years ago
parent
commit
4035675337
No known key found for this signature in database GPG Key ID: FD81DE6D75E20917
  1. 25
      server/src/games/run/types.rs

25
server/src/games/run/types.rs

@ -47,19 +47,18 @@ impl Player {
Ok(().into()) Ok(().into())
} }
pub fn get(&mut self) -> u32 { pub fn get(&mut self) -> i64 {
self.num self.num as i64
} }
pub fn set(&mut self, n: u32) -> RhaiResult<()> { pub fn set(&mut self, n: i64) -> RhaiResult<()> {
// if n < 0 { if n < 0 {
// rhai_error(format!( rhai_error(format!(
// "Can't assign to something smaller than 0 ({} < 0)", "Can't assign to something smaller than 0 ({} < 0)",
// n n
// )) ))
// } else } else if n < self.max as i64 {
if n < self.max { self.num = n as u32;
self.num = n;
Ok(()) Ok(())
} else { } else {
rhai_error(format!( rhai_error(format!(

Loading…
Cancel
Save