<commit_before>#include "script_component.hpp"
/*
    Function: fpa_common_fnc_getPlayer

    API:
        Any

    Description:
        Takes a string and returns a player object if found, otherwise objNull
        Can be used partially, to find "cuel" you can pass ["cu"]
        Will be objNull if not found, or if theres more than one match
        Case insensitive

    Parameters:
        _name - Player name

    Examples:
    (begin example)
        _cuel = "cu" call fpa_common_fnc_getPlayer;
        _cuel = ["Cuel"] call fpa_common_fnc_getPlayer;
    (end)

    Returns:
        Object

    Author:
        Cuel 2015-04-21
*/
params ["_name"];
_name = toLower _name;
private _players = [] call CBA_fnc_players;
private _index = _players findIf {_name in toLower(name _x)};

if (_index isEqualTo -1) exitWith {objNull};
_players select _index;<commit_msg>Make getPlayer function also check for multiple players found, restore same functionality as old function<commit_after>#include "script_component.hpp"
/*
    Function: fpa_common_fnc_getPlayer

    API:
        Any

    Description:
        Takes a string and returns a player object if found, otherwise objNull
        Can be used partially, to find "cuel" you can pass ["cu"]
        Will be objNull if not found, or if theres more than one match
        Case insensitive

    Parameters:
        _name - Player name

    Examples:
    (begin example)
        _cuel = "cu" call fpa_common_fnc_getPlayer;
        _cuel = ["Cuel"] call fpa_common_fnc_getPlayer;
    (end)

    Returns:
        Object

    Author:
        Cuel 2015-04-21
*/
params ["_name"];
_name = toLower _name;
private _players = ([] call CBA_fnc_players) select {_name in toLower(name _x)};
if ((count _players) isEqualTo 1) exitWith {_players select 0};
objNull
{'fraction_non_alphanumeric': 0.07615341856586992, 'fraction_numerical': 0.010561423012784881, 'mean_word_length': 2.8297872340425534, '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': '4542158', 'n_tokens_mistral': 579, 'n_tokens_neox': 551, 'n_words': 195}