From 39b07df2e2cd04e6e921879a7d10d3580895a061 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 29 Mar 2023 17:57:37 -0400 Subject: [PATCH] Sanity check for race rune not in runebase. --- src/engine/gameManager/NPCManager.java | 10 +++++++++- src/engine/objects/Mob.java | 8 +------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/engine/gameManager/NPCManager.java b/src/engine/gameManager/NPCManager.java index 4c111838..daffd23c 100644 --- a/src/engine/gameManager/NPCManager.java +++ b/src/engine/gameManager/NPCManager.java @@ -30,7 +30,10 @@ public enum NPCManager { public static void applyRuneSetEffects(Mob mob) { - EffectsBase effectsBase; + // Early exit + + if (mob.runeSetID == 0) + return;; //Apply all rune effects. @@ -61,6 +64,11 @@ public enum NPCManager { EffectsBase effectsBase; RuneBase sourceRune = RuneBase.getRuneBase(runeID); + // Race runes are in the runeset but not in runebase for some reason + + if (sourceRune == null) + return;; + for (MobBaseEffects mbe : sourceRune.getEffectsList()) { effectsBase = PowersManager.getEffectByToken(mbe.getToken()); diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 08e11072..0bc25e34 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -2106,13 +2106,7 @@ public class Mob extends AbstractIntelligenceAgent { try { NPCManager.applyRuneSetEffects(this); - - try { - this.initializeSkills(); - } catch (Exception e) { - Logger.error(e.getMessage()); - } - + initializeSkills(); recalculateStats(); this.setHealth(this.healthMax);