(7e43eae73) Optimized Item.ApplyStatusEffects & ItemComponent.PlaySound: check if the item has effects/sounds of the correct type from a bool array instead of doing a dictionary lookup. A small thing, but the methods are called so frequently that it adds up to a lot.

This commit is contained in:
Joonas Rikkonen
2019-04-18 12:05:11 +03:00
parent 1a3184dbad
commit b0580a9050
5 changed files with 57 additions and 21 deletions
@@ -219,6 +219,7 @@ namespace Barotrauma.Items.Components
requiredSkills = new List<Skill>();
#if CLIENT
hasSoundsOfType = new bool[Enum.GetValues(typeof(ActionType)).Length];
sounds = new Dictionary<ActionType, List<ItemSound>>();
#endif