diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2020-09-27 21:07:20 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2020-09-27 21:07:20 +0200 |
commit | 434b14bedd53a0f11c2382545b047c960a1fc645 (patch) | |
tree | ae530e4f9d9556ec86af561a1e4c060eeea0209f /src/main/java/re | |
parent | e80587c26dd3b74428d9942c9e6201caa16366ee (diff) | |
download | parquet-434b14bedd53a0f11c2382545b047c960a1fc645.tar.gz |
Calculator Fix kick on wrong entry
Diffstat (limited to 'src/main/java/re')
-rw-r--r-- | src/main/java/re/jag/parquet/commands/Calculator.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/re/jag/parquet/commands/Calculator.java b/src/main/java/re/jag/parquet/commands/Calculator.java index ee8bc53..4cfdb26 100644 --- a/src/main/java/re/jag/parquet/commands/Calculator.java +++ b/src/main/java/re/jag/parquet/commands/Calculator.java @@ -58,6 +58,10 @@ public class Calculator { level_count++; String result = execute_operation(operator, parts.get(o), parts.get(o+1), _source); + + if (result == null) + return 1; + parts.set(o, result); parts.remove(o+1); operators.remove(o); @@ -95,6 +99,7 @@ public class Calculator { operand = (int)player.getPos().z; break; default: + operand = null; } } |