Skip to content

Commit

Permalink
Use default implementation for effect potions when values are out of …
Browse files Browse the repository at this point in the history
…range. Fixes crash on BU for missing effects.
  • Loading branch information
ethanmoffat committed Sep 13, 2022
1 parent 6f59e43 commit a44e8ac
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions EndlessClient/Rendering/Effects/EffectSpriteManager.cs
Expand Up @@ -64,10 +64,15 @@ public IList<IEffectSpriteInfo> GetEffectInfo(EffectType effectType, int effectI

private IList<IEffectSpriteInfo> ResolvePotionEffect(HardCodedPotionEffect effect)
{
var retList = _potionEffects[effect];
foreach(var item in retList)
item.Restart();
return new List<IEffectSpriteInfo>(retList);
if (_potionEffects.ContainsKey(effect))
{
var retList = _potionEffects[effect];
foreach (var item in retList)
item.Restart();
}

// potion graphics that aren't in the hard-coded list here use the same formula as spell graphics
return ResolveSpellEffect((HardCodedSpellGraphic)effect+1);
}

private IList<IEffectSpriteInfo> ResolveSpellEffect(HardCodedSpellGraphic effect)
Expand Down

0 comments on commit a44e8ac

Please sign in to comment.