Skip to content

Commit

Permalink
Use moveInfo.useLoc for player move.
Browse files Browse the repository at this point in the history
  • Loading branch information
asofold committed Oct 25, 2015
1 parent d05e683 commit 18ddb34
Showing 1 changed file with 6 additions and 7 deletions.
Expand Up @@ -399,9 +399,9 @@ public void onPlayerMove(final PlayerMoveEvent event) {
// newTo should be null here.

// Fire one or two moves here.
final Location loc = player.getLocation(useLoc);
final MovingConfig cc = MovingConfig.getConfig(player);
final MoveInfo moveInfo = useMoveInfo();
final Location loc = player.getLocation(moveInfo.useLoc);
if (TrigUtil.isSamePos(from, loc)
|| TrigUtil.isSamePos(loc, data.fromX, data.fromY, data.fromZ)
// Could also be other envelopes (0.9 velocity upwards), too tedious to research.
Expand Down Expand Up @@ -434,7 +434,6 @@ public void onPlayerMove(final PlayerMoveEvent event) {
// Cleanup.
data.joinOrRespawn = false;
returnMoveInfo(moveInfo);
useLoc.setWorld(null);
}

/**
Expand Down Expand Up @@ -864,7 +863,7 @@ private void onVehicleLeaveMiss(final Player player, final MovingData data, fina
}

/**
* Monitor level PlayerMoveEvent.
* Monitor level PlayerMoveEvent. Uses useLoc.
* @param event
*/
@EventHandler(priority=EventPriority.MONITOR, ignoreCancelled = false)
Expand Down Expand Up @@ -893,7 +892,7 @@ public void onPlayerMoveMonitor(final PlayerMoveEvent event) {
final MovingData mData = MovingData.getData(player);
final long tick = TickTask.getTick();
if (!event.isCancelled()) {
final Location pLoc = player.getLocation();
final Location pLoc = player.getLocation(useLoc);
onMoveMonitorNotCancelled(player, TrigUtil.isSamePosAndLook(pLoc, from) ? from : pLoc, event.getTo(), now, tick, data, mData);
useLoc.setWorld(null);
}
Expand All @@ -907,10 +906,10 @@ public void onPlayerMoveMonitor(final PlayerMoveEvent event) {
}

/**
* Overrides useLoc if in vehicle.
* Uses useLoc if in vehicle.
* @param player
* @param from
* @param to
* @param from Might use useLoc, but will reset it, if in vehicle.
* @param to Do not use useLoc for this.
* @param now
* @param tick
* @param data
Expand Down

0 comments on commit 18ddb34

Please sign in to comment.