mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-28 03:57:39 +01:00
Check both attacker and defender locations for PvP.
Fixes WORLDGUARD-3494.
This commit is contained in:
parent
7f9b850288
commit
3cb6c4e46f
@ -455,7 +455,8 @@ public void onDamageEntity(DamageEntityEvent event) {
|
||||
Player defender = (Player) event.getEntity();
|
||||
|
||||
canDamage = query.testBuild(target, associable, combine(event, DefaultFlag.PVP))
|
||||
&& query.queryState(playerAttacker.getLocation(), playerAttacker, combine(event, DefaultFlag.PVP)) != State.DENY;
|
||||
&& query.queryState(playerAttacker.getLocation(), playerAttacker, combine(event, DefaultFlag.PVP)) != State.DENY
|
||||
&& query.queryState(target, playerAttacker, combine(event, DefaultFlag.PVP)) != State.DENY;
|
||||
|
||||
// Fire the disallow PVP event
|
||||
if (!canDamage && Events.fireAndTestCancel(new DisallowedPVPEvent(playerAttacker, defender, event.getOriginalEvent()))) {
|
||||
|
Loading…
Reference in New Issue
Block a user