v3.0.0: fixed rare crashes caused by glyphLevel during load
This commit is contained in:
@@ -699,7 +699,8 @@ public abstract class Char extends Actor {
|
||||
//Returns the level a glyph is at for a char, or -1 if they are not benefitting from that glyph
|
||||
//This function is needed as (unlike enchantments) many glyphs trigger in a variety of cases
|
||||
public int glyphLevel(Class<? extends Armor.Glyph> cls){
|
||||
if (Dungeon.hero != null && this != Dungeon.hero && Dungeon.hero.alignment == alignment
|
||||
if (Dungeon.hero != null && Dungeon.level != null
|
||||
&& this != Dungeon.hero && Dungeon.hero.alignment == alignment
|
||||
&& Dungeon.level.distance(pos, Dungeon.hero.pos) <= 2
|
||||
&& Dungeon.hero.buff(AuraOfProtection.AuraBuff.class) != null) {
|
||||
return Dungeon.hero.glyphLevel(cls);
|
||||
|
||||
Reference in New Issue
Block a user