mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-11-07 11:10:05 +01:00
Fix handling move events while in vehicles.
Bug by "refactoring".
This commit is contained in:
parent
1c248e942f
commit
307e2c6cac
@ -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.
|
||||||
|
Loading…
Reference in New Issue
Block a user