From 6187006ece90f41fbd0088ed91d5b09e31005903 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Sun, 1 May 2016 11:01:26 -0400 Subject: [PATCH] Remove duplicate fnc_inString --- .../functions/KK_fnc_inString.sqf | 30 ------------------- .../functions/z_at_filterList.sqf | 4 +-- .../actions/AdvancedTrading/init.sqf | 2 +- 3 files changed, 3 insertions(+), 33 deletions(-) delete mode 100644 SQF/dayz_code/actions/AdvancedTrading/functions/KK_fnc_inString.sqf diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/KK_fnc_inString.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/KK_fnc_inString.sqf deleted file mode 100644 index 11162909b..000000000 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/KK_fnc_inString.sqf +++ /dev/null @@ -1,30 +0,0 @@ -/* -* Author: Killzone_Kid -* -* Description: -* Find a string within a string (case insensitive) -* -* Parameter(s): -* _this select 0: string to be found -* _this select 1: string to search in -* -* Returns: -* Boolean (true when string is found) -* -* How to use: -* _found = ["needle", "Needle in Haystack"] call KK_fnc_inString; -*/ -private ["_needle","_haystack","_needleLen","_hay","_found"]; -_needle = [_this, 0, "", [""]] call BIS_fnc_param; -_haystack = toArray ([_this, 1, "", [""]] call BIS_fnc_param); -_needleLen = count toArray _needle; -_hay = +_haystack; -_hay resize _needleLen; -_found = false; -for "_i" from _needleLen to count _haystack do { - if (toString _hay == _needle) exitWith {_found = true}; - _hay set [_needleLen, _haystack select _i]; - _hay set [0, "x"]; - _hay = _hay - ["x"] -}; -_found \ No newline at end of file diff --git a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_filterList.sqf b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_filterList.sqf index 8fb4b411b..c24918837 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_filterList.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/functions/z_at_filterList.sqf @@ -24,7 +24,7 @@ if(count _this > 0) then { }else { _newSellArray = []; { - if(( [_query,(_x select 0)] call KK_fnc_inString) || ([_query,(_x select 3)] call KK_fnc_inString) ) then { + if(( [_query,(_x select 0)] call fnc_inString) || ([_query,(_x select 3)] call fnc_inString) ) then { if( _x find Z_SellArray < 0 ) then { _newSellArray set [count(_newSellArray), _x]; }; @@ -42,7 +42,7 @@ if(count _this > 0) then { }else { _newBuyArray = []; { - if(( [_query,(_x select 0)] call KK_fnc_inString) || ([_query,(_x select 3)] call KK_fnc_inString) ) then { + if(( [_query,(_x select 0)] call fnc_inString) || ([_query,(_x select 3)] call fnc_inString) ) then { _newBuyArray set [count(_newBuyArray), _x]; }; } forEach Z_OriginalBuyableArray; diff --git a/SQF/dayz_code/actions/AdvancedTrading/init.sqf b/SQF/dayz_code/actions/AdvancedTrading/init.sqf index 1775bdbd0..b493d3445 100644 --- a/SQF/dayz_code/actions/AdvancedTrading/init.sqf +++ b/SQF/dayz_code/actions/AdvancedTrading/init.sqf @@ -54,7 +54,7 @@ if(isNil "Z_AdvancedTradingInit")then{ /* end script config */ - KK_fnc_inString = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\KK_fnc_inString.sqf"); + fnc_inString = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\fnc_inString.sqf"); ZUPA_fnc_removeWeaponsAndMagazinesCargo = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\zupa_fnc_removeWeaponsAndMagazinesCargo.sqf"); Z_filleTradeTitle = compile preprocessFileLineNumbers (Z_AT_FolderLocation + "\functions\z_at_filleTradeTitle.sqf");