Don't cycle when on child skill

This commit is contained in:
T00thpick1 2013-01-23 23:47:34 -05:00
parent a01882aea5
commit 135bfc2627
3 changed files with 3 additions and 0 deletions

View File

@ -40,6 +40,7 @@ public class McMMOPlayer {
int powerLevel = 0;
for (SkillType type : SkillType.values()) {
if (type.isChildSkill()) continue;
if (type.getPermissions(player)) {
powerLevel += profile.getSkillLevel(type);
}

View File

@ -31,6 +31,7 @@ public class McRankAsync implements Runnable {
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Heading"));
sender.sendMessage(LocaleLoader.getString("Commands.mcrank.Player", new Object[] {playerName}));
for (SkillType skillType : SkillType.values()) {
if (skillType.isChildSkill()) continue;
if (skillType.equals(SkillType.ALL))
continue; // We want the overall ranking to be at the bottom

View File

@ -476,6 +476,7 @@ public class Database {
if (checkConnected()) {
try {
for (SkillType skillType: SkillType.values()) {
if (skillType.isChildSkill()) continue;
String sql;
if(skillType != SkillType.ALL) {
sql = "SELECT COUNT(*) AS rank FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE " + skillType.name().toLowerCase() + " > 0 AND " + skillType.name().toLowerCase() + " > (SELECT " + skillType.name().toLowerCase() + " FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE user = '" + playerName + "')";