<commit_before>﻿using System.Linq;
using TCC.Data;

namespace TCC
{
    public delegate void UpdateAbnormalityEventHandler(ulong target, Abnormality ab, int duration, int stacks);

    public static class AbnormalityManager
    {
        public static event UpdateAbnormalityEventHandler PlayerAbnormalityUpdated;
        public static event UpdateAbnormalityEventHandler NPCAbnormalityUpdated;

        public static void BeginAbnormality(uint id, ulong target, int duration, int stacks)
        {
            if (AbnormalityDatabase.Abnormalities.TryGetValue(id, out Abnormality ab))
            {
                Filter(ab);
                if (target == SessionManager.CurrentPlayer.EntityId)
                {
                    BeginPlayerAbnormality(ab, stacks, duration, target);
                }
                else
                {
                    BeginNPCAbnormality(ab, stacks, duration, target);
                }
            }

        }<commit_msg>fixed filtering of unknown abnormalities<commit_after>﻿using System.Linq;
using TCC.Data;

namespace TCC
{
    public delegate void UpdateAbnormalityEventHandler(ulong target, Abnormality ab, int duration, int stacks);

    public static class AbnormalityManager
    {
        public static event UpdateAbnormalityEventHandler PlayerAbnormalityUpdated;
        public static event UpdateAbnormalityEventHandler NPCAbnormalityUpdated;

        public static void BeginAbnormality(uint id, ulong target, int duration, int stacks)
        {
            if (AbnormalityDatabase.Abnormalities.TryGetValue(id, out Abnormality ab))
            {
                if(!Filter(ab)) return;
                if (target == SessionManager.CurrentPlayer.EntityId)
                {
                    BeginPlayerAbnormality(ab, stacks, duration, target);
                }
                else
                {
                    BeginNPCAbnormality(ab, stacks, duration, target);
                }
            }

        }
{'fraction_non_alphanumeric': 0.06108026249369006, 'fraction_numerical': 0.0, 'mean_word_length': 2.068111455108359, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2200806', 'n_tokens_mistral': 500, 'n_tokens_neox': 471, 'n_words': 125}