mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-12-25 11:36:26 -05:00
Fix crash on exiting "select hero class" screen (#64)
* Fix crash on exiting select hero screen * Remove unneeded using * Revert mistake on ChangeScene
This commit is contained in:
parent
bd4c95c28d
commit
b722405d53
@ -33,15 +33,25 @@ namespace OpenDiablo2.Common.Enums
|
||||
|
||||
public static class eHeroExtensions
|
||||
{
|
||||
public readonly static eHero[] all = {
|
||||
eHero.Barbarian,
|
||||
eHero.Necromancer,
|
||||
eHero.Paladin,
|
||||
eHero.Assassin,
|
||||
eHero.Sorceress,
|
||||
eHero.Amazon,
|
||||
eHero.Druid,
|
||||
};
|
||||
|
||||
public readonly static Dictionary<eHero, string> tokens = new Dictionary<eHero, string>
|
||||
{
|
||||
{ eHero.Amazon , "AM" },
|
||||
{ eHero.Sorceress , "SO" },
|
||||
{ eHero.Barbarian , "BA" },
|
||||
{ eHero.Necromancer , "NE" },
|
||||
{ eHero.Paladin , "PA" },
|
||||
{ eHero.Barbarian , "BA" },
|
||||
{ eHero.Assassin , "AI" },
|
||||
{ eHero.Sorceress , "SO" },
|
||||
{ eHero.Amazon , "AM" },
|
||||
{ eHero.Druid , "DZ" },
|
||||
{ eHero.Assassin , "AI" }
|
||||
};
|
||||
|
||||
public static string ToToken(this eHero source) => tokens[source];
|
||||
|
@ -279,8 +279,7 @@ namespace OpenDiablo2.Scenes
|
||||
{
|
||||
StopSfx();
|
||||
|
||||
var heros = Enum.GetValues(typeof(eHero)).Cast<eHero>();
|
||||
foreach (var hero in heros)
|
||||
foreach (var hero in eHeroExtensions.all)
|
||||
{
|
||||
heroRenderInfo[hero].SpecialFrameTime = 0;
|
||||
heroRenderInfo[hero].Stance = eHeroStance.Idle;
|
||||
|
Loading…
Reference in New Issue
Block a user