Core/Gossip: Use algorithms from std::ranges namespace in gossip menu code
Port From (https://github.com/TrinityCore/TrinityCore/commit/a562f4fafade619ec1289d6f54e14fc28dc010d8)
This commit is contained in:
@@ -35,15 +35,12 @@ namespace Game.Misc
|
||||
orderIndex = (int)(itr.OrderIndex + 1);
|
||||
}
|
||||
|
||||
if (!_menuItems.Empty())
|
||||
foreach (var (_, _menuItem) in _menuItems)
|
||||
{
|
||||
foreach (var pair in _menuItems)
|
||||
{
|
||||
if (pair.Value.OrderIndex > orderIndex)
|
||||
if (_menuItem.OrderIndex > orderIndex)
|
||||
break;
|
||||
|
||||
orderIndex = (int)pair.Value.OrderIndex + 1;
|
||||
}
|
||||
orderIndex = (int)_menuItem.OrderIndex + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -714,13 +711,9 @@ namespace Game.Misc
|
||||
_questMenuItems.Add(questMenuItem);
|
||||
}
|
||||
|
||||
bool HasItem(uint questId)
|
||||
public bool HasItem(uint questId)
|
||||
{
|
||||
foreach (var item in _questMenuItems)
|
||||
if (item.QuestId == questId)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return _questMenuItems.Any(p => p.QuestId == questId);
|
||||
}
|
||||
|
||||
public void ClearMenu()
|
||||
|
||||
Reference in New Issue
Block a user