mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-09-28 14:16:01 -04: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 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>
|
public readonly static Dictionary<eHero, string> tokens = new Dictionary<eHero, string>
|
||||||
{
|
{
|
||||||
{ eHero.Amazon , "AM" },
|
{ eHero.Barbarian , "BA" },
|
||||||
{ eHero.Sorceress , "SO" },
|
|
||||||
{ eHero.Necromancer , "NE" },
|
{ eHero.Necromancer , "NE" },
|
||||||
{ eHero.Paladin , "PA" },
|
{ eHero.Paladin , "PA" },
|
||||||
{ eHero.Barbarian , "BA" },
|
{ eHero.Assassin , "AI" },
|
||||||
|
{ eHero.Sorceress , "SO" },
|
||||||
|
{ eHero.Amazon , "AM" },
|
||||||
{ eHero.Druid , "DZ" },
|
{ eHero.Druid , "DZ" },
|
||||||
{ eHero.Assassin , "AI" }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public static string ToToken(this eHero source) => tokens[source];
|
public static string ToToken(this eHero source) => tokens[source];
|
||||||
|
@ -279,8 +279,7 @@ namespace OpenDiablo2.Scenes
|
|||||||
{
|
{
|
||||||
StopSfx();
|
StopSfx();
|
||||||
|
|
||||||
var heros = Enum.GetValues(typeof(eHero)).Cast<eHero>();
|
foreach (var hero in eHeroExtensions.all)
|
||||||
foreach (var hero in heros)
|
|
||||||
{
|
{
|
||||||
heroRenderInfo[hero].SpecialFrameTime = 0;
|
heroRenderInfo[hero].SpecialFrameTime = 0;
|
||||||
heroRenderInfo[hero].Stance = eHeroStance.Idle;
|
heroRenderInfo[hero].Stance = eHeroStance.Idle;
|
||||||
|
Loading…
Reference in New Issue
Block a user