Browse Source

Sanity check for race rune not in runebase.

master
MagicBot 2 years ago
parent
commit
39b07df2e2
  1. 10
      src/engine/gameManager/NPCManager.java
  2. 8
      src/engine/objects/Mob.java

10
src/engine/gameManager/NPCManager.java

@ -30,7 +30,10 @@ public enum NPCManager {
public static void applyRuneSetEffects(Mob mob) { public static void applyRuneSetEffects(Mob mob) {
EffectsBase effectsBase; // Early exit
if (mob.runeSetID == 0)
return;;
//Apply all rune effects. //Apply all rune effects.
@ -61,6 +64,11 @@ public enum NPCManager {
EffectsBase effectsBase; EffectsBase effectsBase;
RuneBase sourceRune = RuneBase.getRuneBase(runeID); 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()) { for (MobBaseEffects mbe : sourceRune.getEffectsList()) {
effectsBase = PowersManager.getEffectByToken(mbe.getToken()); effectsBase = PowersManager.getEffectByToken(mbe.getToken());

8
src/engine/objects/Mob.java

@ -2106,13 +2106,7 @@ public class Mob extends AbstractIntelligenceAgent {
try { try {
NPCManager.applyRuneSetEffects(this); NPCManager.applyRuneSetEffects(this);
initializeSkills();
try {
this.initializeSkills();
} catch (Exception e) {
Logger.error(e.getMessage());
}
recalculateStats(); recalculateStats();
this.setHealth(this.healthMax); this.setHealth(this.healthMax);

Loading…
Cancel
Save