13
0
geforkt von Mirrors/Paper

Fix accidental Double.MAX_VALUE coordinates in initial PlayerMoveEvent

Dieser Commit ist enthalten in:
Erik Broes 2011-03-24 00:52:10 +01:00
Ursprung 3129348866
Commit 748b71b3cc

Datei anzeigen

@ -123,6 +123,8 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
float deltaAngle = Math.abs(this.lastYaw - this.e.yaw) + Math.abs(this.lastPitch - this.e.pitch); float deltaAngle = Math.abs(this.lastYaw - this.e.yaw) + Math.abs(this.lastPitch - this.e.pitch);
if (delta > 1f/256 || deltaAngle > 10f) { if (delta > 1f/256 || deltaAngle > 10f) {
// Skip the first time we do this
if (lastPosX != Double.MAX_VALUE) {
PlayerMoveEvent event = new PlayerMoveEvent(Type.PLAYER_MOVE, player, from, to); PlayerMoveEvent event = new PlayerMoveEvent(Type.PLAYER_MOVE, player, from, to);
server.getPluginManager().callEvent(event); server.getPluginManager().callEvent(event);
@ -134,6 +136,7 @@ public class NetServerHandler extends NetHandler implements ICommandListener {
this.e.locZ = to.getZ(); this.e.locZ = to.getZ();
this.e.yaw = to.getYaw(); this.e.yaw = to.getYaw();
this.e.pitch = to.getPitch(); this.e.pitch = to.getPitch();
}
this.lastPosX = this.e.locX; this.lastPosX = this.e.locX;
this.lastPosY = this.e.locY; this.lastPosY = this.e.locY;