Fix handling move events while in vehicles.

Bug by "refactoring".
This commit is contained in:
asofold 2014-04-27 22:34:25 +02:00
parent 1c248e942f
commit 307e2c6cac

View File

@ -375,10 +375,11 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
// TODO: Check if vehicle move logs correctly (fake). // TODO: Check if vehicle move logs correctly (fake).
// Early return checks (no full processing). // Early return checks (no full processing).
boolean earlyReturn = false; final boolean earlyReturn;
if (player.isInsideVehicle()) { if (player.isInsideVehicle()) {
// No full processing for players in vehicles. // No full processing for players in vehicles.
newTo = onPlayerMoveVehicle(player, from, to, data); newTo = onPlayerMoveVehicle(player, from, to, data);
earlyReturn = true;
} else if (player.isDead() || player.isSleeping()) { } else if (player.isDead() || player.isSleeping()) {
// Ignore dead players. // Ignore dead players.
data.sfHoverTicks = -1; data.sfHoverTicks = -1;
@ -392,10 +393,12 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
// Keep hover ticks. // Keep hover ticks.
// Ignore changing worlds. // Ignore changing worlds.
earlyReturn = true; earlyReturn = true;
} // else: Continue with full processing. } else {
earlyReturn = false;
}
// TODO: Might log base parts here (+extras). // TODO: Might log base parts here (+extras).
if (earlyReturn || newTo != null) { if (earlyReturn) {
// TODO: Log "early return: " + tags. // TODO: Log "early return: " + tags.
if (newTo != null) { if (newTo != null) {
// Illegal Yaw/Pitch. // Illegal Yaw/Pitch.