mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
b489750d5b
* Optimizations with private, params, and isEqualType * Fixed tab being used instead of space * Fixed tabs inserted by notepad++ * More usage of new private syntax and params - changed a few checks for an array being empty to `_arr isEqualTo []` rather than `count _arr == 0` - added more uses of `private` on the same line as the variable is declared - added more uses of params to assign variables passed as parameters - removed unnecessary parentheses - removed several unnecessary variable declarations with private array syntax * clean up and formatting
41 lines
1000 B
Plaintext
41 lines
1000 B
Plaintext
/*
|
|
* Author: PabstMirror
|
|
*
|
|
* Verifies magazines moved with exact ammo counts preserved.
|
|
* Arrays will be in format from magazinesAmmo/magazinesAmmoCargo
|
|
* e.g.: [["30Rnd_65x39_caseless_mag",15], ["30Rnd_65x39_caseless_mag",30]]
|
|
*
|
|
* Arguments:
|
|
* 0: Start on container A <ARRAY>
|
|
* 1: End on container A <ARRAY>
|
|
* 2: Start on container B <ARRAY>
|
|
* 3: End on container B <ARRAY>
|
|
*
|
|
* Return Value:
|
|
* Verified Good <BOOL>
|
|
*
|
|
* Example:
|
|
* [stuff] call ace_disarming_fnc_verifyMagazinesMoved
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
PARAMS_4(_startA,_endA,_startB,_endB);
|
|
|
|
//Quick Lazy Count Check
|
|
if (((count _startA) + (count _startB)) != ((count _endA) + (count _endB))) exitWith {
|
|
false
|
|
};
|
|
|
|
private _beginingArray = (_startA + _startB);
|
|
|
|
private _problem = false;
|
|
{
|
|
private _index = _beginingArray find _x;
|
|
if (_index == -1) exitWith {_problem = true;};
|
|
_beginingArray deleteAt _index;
|
|
} forEach (_endA + _endB);
|
|
|
|
(!_problem) && {_beginingArray isEqualTo []}
|