Browse Source

Fixing an error with shake and RNG calculations

nossr50 6 years ago
parent
commit
3734300e59

+ 1 - 0
Changelog.txt

@@ -15,6 +15,7 @@ Version 2.1.2
     (Skills) Fixed a bug where Arcane Forging didn't calculate success and failure correctly
     (Skills) Fixed a bug where Salvage didn't calculate success and failure correctly
     (Skills) Fixed a bug where Flux Mining didn't calculate success correctly
+    (Skills) Fixed a bug where Shake didn't calculate correctly
     (Skills) Tree Feller now works on Mushroom Stems
     (Skills) Fixed a bug where magic chance would show as null
     (Skills) Fixed a bug where Trap percentages were added to Fishing even though they no longer exist

+ 2 - 1
src/main/java/com/gmail/nossr50/skills/fishing/FishingManager.java

@@ -18,6 +18,7 @@ import com.gmail.nossr50.events.skills.fishing.McMMOPlayerShakeEvent;
 import com.gmail.nossr50.skills.SkillManager;
 import com.gmail.nossr50.util.*;
 import com.gmail.nossr50.util.player.NotificationManager;
+import com.gmail.nossr50.util.random.RandomChanceSkillStatic;
 import com.gmail.nossr50.util.random.RandomChanceUtil;
 import com.gmail.nossr50.util.skills.CombatUtils;
 import com.gmail.nossr50.util.skills.RankUtils;
@@ -267,7 +268,7 @@ public class FishingManager extends SkillManager {
      * @param target The {@link LivingEntity} affected by the ability
      */
     public void shakeCheck(LivingEntity target) {
-        if (RandomChanceUtil.checkRandomChanceExecutionSuccess(getPlayer(), SubSkillType.FISHING_SHAKE, true)) {
+        if (RandomChanceUtil.checkRandomChanceExecutionSuccess(new RandomChanceSkillStatic(getShakeChance(), getPlayer(), SubSkillType.FISHING_SHAKE))) {
             List<ShakeTreasure> possibleDrops = Fishing.findPossibleDrops(target);
 
             if (possibleDrops == null || possibleDrops.isEmpty()) {