浏览代码

Acrobatics: cap same-location fall counter for XP gain
It used to increase boundlessly, thus preventing players from gaining XP for a while even after moving to another place.

Ivo Julca 10 年之前
父节点
当前提交
958c116fd0
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java

+ 3 - 2
src/main/java/com/gmail/nossr50/skills/acrobatics/AcrobaticsManager.java

@@ -142,13 +142,14 @@ public class AcrobaticsManager extends SkillManager {
         }
         }
 
 
         Location fallLocation = player.getLocation();
         Location fallLocation = player.getLocation();
+        int maxTries = Config.getInstance().getAcrobaticsAFKMaxTries();
 
 
         boolean sameLocation = (lastFallLocation != null && Misc.isNear(lastFallLocation, fallLocation, 2));
         boolean sameLocation = (lastFallLocation != null && Misc.isNear(lastFallLocation, fallLocation, 2));
 
 
-        fallTries = sameLocation ? fallTries + 1 : Math.max(fallTries - 1, 0);
+        fallTries = sameLocation ? Math.min(fallTries + 1, maxTries) : Math.max(fallTries - 1, 0);
         lastFallLocation = fallLocation;
         lastFallLocation = fallLocation;
 
 
-        return fallTries > Config.getInstance().getAcrobaticsAFKMaxTries();
+        return fallTries >= maxTries;
     }
     }
 
 
     private boolean isFatal(double damage) {
     private boolean isFatal(double damage) {