#2671: Fix command packet parsing for Float/Double arguments

This commit is contained in:
Brokkonaut 2019-07-13 06:11:54 +02:00 committed by md_5
parent 941d7f7262
commit 7669801e69

View File

@ -357,7 +357,7 @@ public class Commands extends DefinedPacket
{
byte flags = buf.readByte();
float min = ( flags & 0x1 ) != 0 ? buf.readFloat() : -Float.MAX_VALUE;
float max = ( flags & 0x2 ) != 0 ? buf.readFloat() : -Float.MAX_VALUE;
float max = ( flags & 0x2 ) != 0 ? buf.readFloat() : Float.MAX_VALUE;
return FloatArgumentType.floatArg( min, max );
}
@ -386,7 +386,7 @@ public class Commands extends DefinedPacket
{
byte flags = buf.readByte();
double min = ( flags & 0x1 ) != 0 ? buf.readDouble() : -Double.MAX_VALUE;
double max = ( flags & 0x2 ) != 0 ? buf.readDouble() : -Double.MAX_VALUE;
double max = ( flags & 0x2 ) != 0 ? buf.readDouble() : Double.MAX_VALUE;
return DoubleArgumentType.doubleArg( min, max );
}