mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-06 19:09:30 +01:00
Don't call initialize() on non-cancellable movements.
Fixes WORLDGUARD-3362.
This commit is contained in:
parent
91ccb95672
commit
752ccec150
@ -223,12 +223,6 @@ public Location testMoveTo(Player player, Location to, MoveType moveType, boolea
|
|||||||
lastRegionSet = toSet.getRegions();
|
lastRegionSet = toSet.getRegions();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Some handlers (see: exit flag) store 'last position data' that
|
|
||||||
// becomes invalid if we're going to let the player move anyway
|
|
||||||
if (moveType.isCancellable()) {
|
|
||||||
resetState(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ protected boolean onSetValue(Player player, Location from, Location to, Applicab
|
|||||||
|
|
||||||
LocalPlayer localPlayer = getPlugin().wrapPlayer(player);
|
LocalPlayer localPlayer = getPlugin().wrapPlayer(player);
|
||||||
|
|
||||||
if (allowed && !lastAllowed && !(moveType.isTeleport() && exitViaTeleport)) {
|
if (allowed && !lastAllowed && !(moveType.isTeleport() && exitViaTeleport) && moveType.isCancellable()) {
|
||||||
Boolean override = toSet.queryValue(localPlayer, DefaultFlag.EXIT_OVERRIDE);
|
Boolean override = toSet.queryValue(localPlayer, DefaultFlag.EXIT_OVERRIDE);
|
||||||
if (override == null || !override) {
|
if (override == null || !override) {
|
||||||
sendMessage(player);
|
sendMessage(player);
|
||||||
@ -93,7 +93,7 @@ protected boolean onAbsentValue(Player player, Location from, Location to, Appli
|
|||||||
|
|
||||||
boolean lastAllowed = StateFlag.test(lastValue);
|
boolean lastAllowed = StateFlag.test(lastValue);
|
||||||
|
|
||||||
if (!lastAllowed) {
|
if (!lastAllowed && moveType.isCancellable()) {
|
||||||
Boolean override = toSet.queryValue(getPlugin().wrapPlayer(player), DefaultFlag.EXIT_OVERRIDE);
|
Boolean override = toSet.queryValue(getPlugin().wrapPlayer(player), DefaultFlag.EXIT_OVERRIDE);
|
||||||
if (override == null || !override) {
|
if (override == null || !override) {
|
||||||
sendMessage(player);
|
sendMessage(player);
|
||||||
|
Loading…
Reference in New Issue
Block a user