Skip to content
Permalink
Browse files

For jumpheight setting in /hacks, user should be able to input height…

… in decimal (instead of cryptic 'unit of 32')
  • Loading branch information...
UnknownShadow200 committed Jul 2, 2017
1 parent 1617f8b commit f3f57f5b15a872bc7b87aa153cafaf5be6c5c498
Showing with 10 additions and 7 deletions.
  1. +10 −7 fCraft/Commands/CpeCommands.cs
@@ -2151,16 +2151,19 @@ static class CpeCommands {
case "jump":
case "height":
case "jh":
short height;
float height;
string third = cmd.Next();
if (short.TryParse(third, out height)) {
if (!float.TryParse(third, out height)) {
player.Message("Error: Could not parse \"&a{0}&S\" as a decimal.", third);
return;
} else if (height < 0 || height > short.MaxValue / 32.0f) {
player.Message("Error: Jump height must be between &a0&S and &a1023.", third);
return;
} else {
player.Message("Hacks for {0}", target.ClassyName);
player.Message(" JumpHeight: &a{0} &S--> &a{1}", target.JumpHeight, height);
target.JumpHeight = height;
player.Message(" JumpHeight: &a{0} &S--> &a{1}", target.JumpHeight / 32.0f, height);
target.JumpHeight = (short)(height * 32);
hackStr = "jumpheight";
} else {
player.Message("Error: Could not parse \"&a{0}&S\" as a short. Try something between &a0&S and &a32767", third);
return;
}
break;
default:

0 comments on commit f3f57f5

Please sign in to comment.
You can’t perform that action at this time.