Fixes pet action bar loading wrong data.

This commit is contained in:
hondacrx
2017-07-05 12:08:44 -04:00
parent df5169784f
commit 595d43de16
+5 -3
View File
@@ -60,6 +60,7 @@ namespace Game.Entities
public void InitPetActionBar() public void InitPetActionBar()
{ {
// the first 3 SpellOrActions are attack, follow and stay // the first 3 SpellOrActions are attack, follow and stay
for (byte i = 0; i < SharedConst.ActionBarIndexPetSpellStart - SharedConst.ActionBarIndexStart; ++i) for (byte i = 0; i < SharedConst.ActionBarIndexPetSpellStart - SharedConst.ActionBarIndexStart; ++i)
SetActionBar((byte)(SharedConst.ActionBarIndexStart + i), (uint)CommandStates.Attack - i, ActiveStates.Command); SetActionBar((byte)(SharedConst.ActionBarIndexStart + i), (uint)CommandStates.Attack - i, ActiveStates.Command);
@@ -247,10 +248,11 @@ namespace Game.Entities
if (tokens.Length != (SharedConst.ActionBarIndexEnd - SharedConst.ActionBarIndexStart) * 2) if (tokens.Length != (SharedConst.ActionBarIndexEnd - SharedConst.ActionBarIndexStart) * 2)
return; // non critical, will reset to default return; // non critical, will reset to default
for (byte index = SharedConst.ActionBarIndexStart; index < SharedConst.ActionBarIndexEnd; ++index) byte index = 0;
for (byte i = 0; i < tokens.Length && index < SharedConst.ActionBarIndexEnd; ++i, ++index)
{ {
ActiveStates type = tokens[index++].ToEnum<ActiveStates>(); ActiveStates type = tokens[i++].ToEnum<ActiveStates>();
uint action = uint.Parse(tokens[index]); uint action = uint.Parse(tokens[i]);
PetActionBar[index].SetActionAndType(action, type); PetActionBar[index].SetActionAndType(action, type);