File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -2151,16 +2151,19 @@ static void HackControlHandler(Player player, CommandReader cmd) {
21512151 case "jump" :
21522152 case "height" :
21532153 case "jh" :
2154- short height ;
2154+ float height ;
21552155 string third = cmd . Next ( ) ;
2156- if ( short . TryParse ( third , out height ) ) {
2156+ if ( ! float . TryParse ( third , out height ) ) {
2157+ player . Message ( "Error: Could not parse \" &a{0}&S\" as a decimal." , third ) ;
2158+ return ;
2159+ } else if ( height < 0 || height > short . MaxValue / 32.0f ) {
2160+ player . Message ( "Error: Jump height must be between &a0&S and &a1023." , third ) ;
2161+ return ;
2162+ } else {
21572163 player . Message ( "Hacks for {0}" , target . ClassyName ) ;
2158- player . Message ( " JumpHeight: &a{0} &S--> &a{1}" , target . JumpHeight , height ) ;
2159- target . JumpHeight = height ;
2164+ player . Message ( " JumpHeight: &a{0} &S--> &a{1}" , target . JumpHeight / 32.0f , height ) ;
2165+ target . JumpHeight = ( short ) ( height * 32 ) ;
21602166 hackStr = "jumpheight" ;
2161- } else {
2162- player . Message ( "Error: Could not parse \" &a{0}&S\" as a short. Try something between &a0&S and &a32767" , third ) ;
2163- return ;
21642167 }
21652168 break ;
21662169 default :
You can’t perform that action at this time.
0 commit comments