2018-09-17 19:19:29 +00:00
|
|
|
#include "script_component.hpp"
|
2015-03-17 19:43:50 +00:00
|
|
|
/*
|
|
|
|
* Author: PabstMirror
|
2015-08-09 03:18:26 +00:00
|
|
|
*
|
2015-03-17 19:43:50 +00:00
|
|
|
* 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:
|
2015-03-21 01:17:49 +00:00
|
|
|
* [stuff] call ace_disarming_fnc_verifyMagazinesMoved
|
2015-03-17 19:43:50 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
2017-10-10 14:39:59 +00:00
|
|
|
params ["_startA", "_endA", "_startB", "_endB"];
|
2015-03-17 19:43:50 +00:00
|
|
|
|
|
|
|
//Quick Lazy Count Check
|
|
|
|
if (((count _startA) + (count _startB)) != ((count _endA) + (count _endB))) exitWith {
|
|
|
|
false
|
|
|
|
};
|
|
|
|
|
2016-09-04 14:44:22 +00:00
|
|
|
private _beginingArray = (_startA + _startB);
|
2015-03-17 19:43:50 +00:00
|
|
|
|
2016-09-04 14:44:22 +00:00
|
|
|
private _problem = false;
|
2015-03-17 19:43:50 +00:00
|
|
|
{
|
2016-09-04 14:44:22 +00:00
|
|
|
private _index = _beginingArray find _x;
|
2015-03-17 19:43:50 +00:00
|
|
|
if (_index == -1) exitWith {_problem = true;};
|
|
|
|
_beginingArray deleteAt _index;
|
2015-08-15 01:13:41 +00:00
|
|
|
} forEach (_endA + _endB);
|
2015-03-17 19:43:50 +00:00
|
|
|
|
|
|
|
(!_problem) && {_beginingArray isEqualTo []}
|