Browse Source

Fix visual bug in Hunting Bonus window.

Even when the current state of the Hunting Bonus is "Quit", the state
should display "Paused" when using Nevits Hourglass
HorridoJoho 2 years ago
parent
commit
2b31295257

+ 6 - 0
src/main/java/com/l2jserver/gameserver/model/entity/RecommendationSystem.java

@@ -137,6 +137,7 @@ public class RecommendationSystem {
 		
 		if (!isBonusTaskActive()) {
 			_player.debugFeature("RecBonus", "Not stopping task because it is not started.");
+			_player.sendPacket(new ExVoteSystemInfo(_player));
 			return;
 		}
 
@@ -236,6 +237,11 @@ public class RecommendationSystem {
 		return _recomLeft;
 	}
 	
+	/** @return Whether the recommendation bonus timer is paused */
+	public boolean isBonusPaused() {
+		return _recoBonusPeacePause || _recoBonusOtherPause.get() > 0;
+	}
+	
 	/** @return Whether the recommendation bonus end timer was scheduled */
 	public boolean isBonusTaskActive() {
 		return _recoBonusTask != null && !_recoBonusTask.isCancelled() && !_recoBonusTask.isDone();

+ 1 - 1
src/main/java/com/l2jserver/gameserver/network/serverpackets/ExVoteSystemInfo.java

@@ -42,6 +42,6 @@ public class ExVoteSystemInfo extends L2GameServerPacket {
 		writeD(_player.getRecSystem().getHave());
 		writeD(_player.getRecSystem().getBonusTime());
 		writeD(_player.getRecSystem().getBonus());
-		writeD((!_player.getRecSystem().isBonusTaskActive() && _player.getRecSystem().getBonusTime() > 0) ? 0x01 : 0x00);
+		writeD(_player.getRecSystem().isBonusPaused() ? 0x01 : 0x00);
 	}
 }