changed findFactions() method to try matching faction tags before trying to match player names, instead of the other way around

This commit is contained in:
Brettflan committed 2011-08-03 21:49:11 -05:00
1 parent f9d39271c0
commit 2900bf372f
2 files changed
+8 -8

No files matched your search

@@ -190,17 +190,17 @@ public class FBaseCommand {
public Faction findFaction(String factionName, boolean defaultToMine) {
// First we search player names
FPlayer fp = FPlayer.find(factionName);
if (fp != null) {
return fp.getFaction();
}
// Secondly we search faction names
// First we search faction names
Faction faction = Faction.findByTag(factionName);
if (faction != null) {
return faction;
}
// Next we search player names
FPlayer fp = FPlayer.find(factionName);
if (fp != null) {
return fp.getFaction();
}
if (defaultToMine && sender instanceof Player) {
return me.getFaction();