소스 검색

Fixed bug where the PTP cooldown was being read improperly

TfT_02 12 년 전
부모
커밋
3440833af8
2개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 0
      Changelog.txt
  2. 2 2
      src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java

+ 2 - 0
Changelog.txt

@@ -11,6 +11,8 @@ Version 1.4.02-dev
  + Added API to get the skill and power level caps.
  = Fixed bug where Deflect was calculated based on the attacker, not the defender
  = Fixed bug where some skills weren't registering as unlocked until one level later
+ = Fixed bug where the PTP cooldown was being read improperly
+ = Fixed bug where /ptp <accept|toggle|acceptall> where broken
 
 Version 1.4.01
  = Fixed bug where trying to use /mctop or /xplock with the Smelting child skill caused NPEs

+ 2 - 2
src/main/java/com/gmail/nossr50/commands/party/PtpCommand.java

@@ -54,9 +54,9 @@ public class PtpCommand implements CommandExecutor {
                 }
 
                 int ptpCooldown = Config.getInstance().getPTPCommandCooldown();
-                long recentlyHurt = UserManager.getPlayer(player).getRecentlyHurt() * Misc.TIME_CONVERSION_FACTOR;
+                long recentlyHurt = UserManager.getPlayer(player).getRecentlyHurt();
 
-                if (System.currentTimeMillis() - recentlyHurt >= (ptpCooldown * Misc.TIME_CONVERSION_FACTOR)) {
+                if ((recentlyHurt * Misc.TIME_CONVERSION_FACTOR + ptpCooldown * Misc.TIME_CONVERSION_FACTOR) > System.currentTimeMillis()) {
                     player.sendMessage(LocaleLoader.getString("Party.Teleport.Hurt", ptpCooldown));
                     return true;
                 }