No known key found for this signature in database
GPG Key ID: FD81DE6D75E20917
1 changed files with
10 additions and
11 deletions
-
server/src/games/run/types.rs
|
|
|
@ -47,19 +47,18 @@ impl Player { |
|
|
|
Ok(().into()) |
|
|
|
} |
|
|
|
|
|
|
|
pub fn get(&mut self) -> u32 { |
|
|
|
self.num |
|
|
|
pub fn get(&mut self) -> i64 { |
|
|
|
self.num as i64 |
|
|
|
} |
|
|
|
|
|
|
|
pub fn set(&mut self, n: u32) -> RhaiResult<()> { |
|
|
|
// if n < 0 {
|
|
|
|
// rhai_error(format!(
|
|
|
|
// "Can't assign to something smaller than 0 ({} < 0)",
|
|
|
|
// n
|
|
|
|
// ))
|
|
|
|
// } else
|
|
|
|
if n < self.max { |
|
|
|
self.num = n; |
|
|
|
pub fn set(&mut self, n: i64) -> RhaiResult<()> { |
|
|
|
if n < 0 { |
|
|
|
rhai_error(format!( |
|
|
|
"Can't assign to something smaller than 0 ({} < 0)", |
|
|
|
n |
|
|
|
)) |
|
|
|
} else if n < self.max as i64 { |
|
|
|
self.num = n as u32; |
|
|
|
Ok(()) |
|
|
|
} else { |
|
|
|
rhai_error(format!( |
|
|
|
|