Use distance for flying violations, not squared.

This commit is contained in:
asofold 2012-09-27 12:43:01 +02:00
parent 14da78fa8d
commit 7a1308e996
2 changed files with 2 additions and 2 deletions

View File

@ -158,7 +158,7 @@ public class CreativeFly extends Check {
final Map<ParameterName, String> parameters = super.getParameterMap(violationData);
parameters.put(ParameterName.LOCATION_FROM, String.format(Locale.US, "%.2f, %.2f, %.2f", data.from.getX(), data.from.getY(), data.from.getZ()));
parameters.put(ParameterName.LOCATION_TO, String.format(Locale.US, "%.2f, %.2f, %.2f", data.to.getX(), data.to.getY(), data.to.getZ()));
parameters.put(ParameterName.DISTANCE, String.format(Locale.US, "%.2f", data.to.getLocation().subtract(data.from.getLocation()).lengthSquared()));
parameters.put(ParameterName.DISTANCE, String.format(Locale.US, "%.2f", data.to.getLocation().subtract(data.from.getLocation()).length()));
return parameters;
}

View File

@ -280,7 +280,7 @@ public class SurvivalFly extends Check {
final Map<ParameterName, String> parameters = super.getParameterMap(violationData);
parameters.put(ParameterName.LOCATION_FROM, String.format(Locale.US, "%.2f, %.2f, %.2f", data.from.getX(), data.from.getY(), data.from.getZ()));
parameters.put(ParameterName.LOCATION_TO, String.format(Locale.US, "%.2f, %.2f, %.2f", data.to.getX(), data.to.getY(), data.to.getZ()));
parameters.put(ParameterName.DISTANCE, String.format(Locale.US, "%.2f", data.to.getLocation().subtract(data.from.getLocation()).lengthSquared()));
parameters.put(ParameterName.DISTANCE, String.format(Locale.US, "%.2f", data.to.getLocation().subtract(data.from.getLocation()).length()));
return parameters;
}