Skip to content

Commit bc83400

Browse files
committed
chore: spell items
1 parent 2e4900a commit bc83400

1 file changed

Lines changed: 16 additions & 14 deletions

File tree

Intersect.Client.Core/Interface/Game/Spells/SpellItem.cs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,22 +219,24 @@ public override void Update()
219219
Icon.RenderColor.A = 255;
220220
}
221221

222-
if (Path.GetFileName(Icon.Texture?.Name) != spell.Icon)
222+
if (Icon.TextureFilename == spell.Icon)
223223
{
224-
var spellIconTexture = GameContentManager.Current.GetTexture(TextureType.Spell, spell.Icon);
225-
if (spellIconTexture != null)
226-
{
227-
Icon.Texture = spellIconTexture;
228-
Icon.RenderColor.A = (byte)(_cooldownLabel.IsVisibleInParent ? 100 : 255);
229-
Icon.IsVisibleInParent = true;
230-
}
231-
else
224+
return;
225+
}
226+
227+
var spellTexture = GameContentManager.Current.GetTexture(TextureType.Spell, spell.Icon);
228+
if (spellTexture != default)
229+
{
230+
Icon.Texture = spellTexture;
231+
Icon.RenderColor.A = (byte)(_cooldownLabel.IsVisibleInParent ? 100 : 255);
232+
Icon.IsVisibleInParent = true;
233+
}
234+
else
235+
{
236+
if (Icon.Texture != null)
232237
{
233-
if (Icon.Texture != null)
234-
{
235-
Icon.Texture = null;
236-
Icon.IsVisibleInParent = false;
237-
}
238+
Icon.Texture = null;
239+
Icon.IsVisibleInParent = false;
238240
}
239241
}
240242
}

0 commit comments

Comments
 (0)