Skip to content

Commit

Permalink
Bard heal song fix (#158)
Browse files Browse the repository at this point in the history
fix for bard healing song being overridden by songs in other spec lines
  • Loading branch information
OntheDOL authored and dol-leodagan committed Dec 10, 2018
1 parent 7d0a43b commit 5db0e6b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions GameServer/gameobjects/GamePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3928,28 +3928,28 @@ public virtual List<Tuple<Skill, Skill>> GetAllUsableSkills(bool update = false)
}

// Add Songs
int songIndex = -1;
foreach (Specialization spec in specs.Where(item => item.HybridSpellList))
{
int index = -1;
{
foreach(KeyValuePair<SpellLine, List<Skill>> sl in spec.GetLinesSpellsForLiving(this))
{
foreach (Spell sp in sl.Value.Where(it => (it is Spell) && ((Spell)it).NeedInstrument).Cast<Spell>())
{
if (index < innerList.Count)
index = innerList.FindIndex(index + 1, e => (e.Item1 is Spell) && ((Spell)e.Item1).NeedInstrument);
if (songIndex < innerList.Count)
songIndex = innerList.FindIndex(songIndex + 1, e => (e.Item1 is Spell) && ((Spell)e.Item1).NeedInstrument);

if (index < 0 || index >= innerList.Count)
if (songIndex < 0 || songIndex >= innerList.Count)
{
// add
innerList.Add(new Tuple<Skill, Skill>(sp, sl.Key));
// disable replace
index = innerList.Count;
songIndex = innerList.Count;
}
else
{
copylist.Remove(innerList[index]);
copylist.Remove(innerList[songIndex]);
// replace
innerList[index] = new Tuple<Skill, Skill>(sp, sl.Key);
innerList[songIndex] = new Tuple<Skill, Skill>(sp, sl.Key);
}
}
}
Expand Down

0 comments on commit 5db0e6b

Please sign in to comment.