Skip to content

Commit

Permalink
Add check for NPC renderer existence before attempting to show damage…
Browse files Browse the repository at this point in the history
… counter
  • Loading branch information
ethanmoffat committed Sep 15, 2022
1 parent aaa474b commit 64e1ba7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion EndlessClient/Rendering/NPC/NPCActions.cs
Expand Up @@ -103,7 +103,8 @@ public void ShowNPCSpeechBubble(int npcIndex, string message)

public void NPCTakeDamage(short npcIndex, int fromPlayerId, int damageToNpc, short npcPctHealth, Option<int> spellId)
{
_npcRendererRepository.NPCRenderers[npcIndex].ShowDamageCounter(damageToNpc, npcPctHealth, isHeal: false);
if (_npcRendererRepository.NPCRenderers.ContainsKey(npcIndex))
_npcRendererRepository.NPCRenderers[npcIndex].ShowDamageCounter(damageToNpc, npcPctHealth, isHeal: false);

spellId.MatchSome(spell =>
{
Expand Down

0 comments on commit 64e1ba7

Please sign in to comment.