mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2025-03-11 14:09:40 +01:00
Two fixes for MovingListener/join.
* Catch a null location. * Set the set back after resetting fly data, if a location is given.
This commit is contained in:
parent
091d29cbbc
commit
290fc0feb0
@ -1188,13 +1188,17 @@ public class MovingListener extends CheckListener implements TickListener, IRemo
|
|||||||
final Location loc = player.getLocation();
|
final Location loc = player.getLocation();
|
||||||
|
|
||||||
// Correct set-back on world changes.
|
// Correct set-back on world changes.
|
||||||
if (!data.hasSetBack()){
|
if (loc == null){
|
||||||
|
// Bug on server side ?
|
||||||
|
data.clearFlyData();
|
||||||
|
}
|
||||||
|
else if (!data.hasSetBack()){
|
||||||
// TODO: Might consider something else like with respawn. Check if it is passable ?
|
// TODO: Might consider something else like with respawn. Check if it is passable ?
|
||||||
data.setSetBack(loc);
|
data.setSetBack(loc);
|
||||||
}
|
}
|
||||||
else if (data.hasSetBackWorldChanged(loc)){
|
else if (data.hasSetBackWorldChanged(loc)){
|
||||||
data.setSetBack(loc);
|
|
||||||
data.clearFlyData();
|
data.clearFlyData();
|
||||||
|
data.setSetBack(loc);
|
||||||
}
|
}
|
||||||
if (data.fromX == Double.MAX_VALUE && data.toX == Double.MAX_VALUE){
|
if (data.fromX == Double.MAX_VALUE && data.toX == Double.MAX_VALUE){
|
||||||
// TODO: re-think: more fine grained reset?
|
// TODO: re-think: more fine grained reset?
|
||||||
|
Loading…
Reference in New Issue
Block a user