fix for piston retraction not working if faction doesn't have build rights in its own territory; missed this when fixing the same thing for piston extension recently

This commit is contained in:
Brettflan 2012-11-09 17:47:53 -06:00
parent 5c45ea5ee2
commit 95289e1411

View File

@ -158,7 +158,11 @@ public class FactionsBlockListener implements Listener
if (targetLoc.getBlock().isEmpty()) return;
Faction pistonFaction = Board.getFactionAt(new FLocation(event.getBlock()));
// members of faction might not have build rights in their own territory, but pistons should still work regardless; so, address that corner case
Faction targetFaction = Board.getFactionAt(new FLocation(targetLoc));
if (targetFaction == pistonFaction) return;
if ( ! FPerm.BUILD.has(pistonFaction, targetLoc))
{
event.setCancelled(true);