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 { @@ -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 { @@ -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());

8
src/engine/objects/Mob.java

@ -2106,13 +2106,7 @@ public class Mob extends AbstractIntelligenceAgent { @@ -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);

Loading…
Cancel
Save