From 1defa2984b474f0ddb07728c3bb71531c94fd0a5 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Fri, 6 Apr 2012 13:27:23 -0500 Subject: [PATCH] Relation commands will now cancel out if the same relation is already set with the target faction. --- src/com/massivecraft/factions/cmd/FRelationCommand.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/com/massivecraft/factions/cmd/FRelationCommand.java b/src/com/massivecraft/factions/cmd/FRelationCommand.java index 52d39ee9..6ed76a40 100644 --- a/src/com/massivecraft/factions/cmd/FRelationCommand.java +++ b/src/com/massivecraft/factions/cmd/FRelationCommand.java @@ -47,6 +47,12 @@ public abstract class FRelationCommand extends FCommand return; } + if (myFaction.getRelationWish(them) == targetRelation) + { + msg("You already have that relation wish set with %s.", them.getTag()); + return; + } + // if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay if ( ! payForCommand(targetRelation.getRelationCost(), "to change a relation wish", "for changing a relation wish")) return;