mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
reduce array size and reverse functions
This commit is contained in:
@@ -37,7 +37,7 @@ vehicle_handleInteract = {
|
|||||||
[_object, "all"] call server_updateObject;
|
[_object, "all"] call server_updateObject;
|
||||||
};
|
};
|
||||||
|
|
||||||
array_reduceReverse = {
|
array_reduceSizeReverse = {
|
||||||
private["_array","_count","_num","_newarray","_startnum","_index"];
|
private["_array","_count","_num","_newarray","_startnum","_index"];
|
||||||
_array = _this select 0;
|
_array = _this select 0;
|
||||||
_newarray = [];
|
_newarray = [];
|
||||||
@@ -54,6 +54,23 @@ array_reduceReverse = {
|
|||||||
_array
|
_array
|
||||||
};
|
};
|
||||||
|
|
||||||
|
array_reduceSize = {
|
||||||
|
private["_array","_count","_num","_newarray","_startnum","_index"];
|
||||||
|
_array = _this select 0;
|
||||||
|
_newarray = [];
|
||||||
|
_count = _this select 1;
|
||||||
|
_num = count _array;
|
||||||
|
if (_num > _count) then {
|
||||||
|
_startnum = _num - 1;
|
||||||
|
_index = _count - 1;
|
||||||
|
for "_i" from 0 to _index do {
|
||||||
|
_newarray set [_i,_array select _i];
|
||||||
|
};
|
||||||
|
_array = _newarray;
|
||||||
|
};
|
||||||
|
_array
|
||||||
|
};
|
||||||
|
|
||||||
vehicle_handleServerKilled = {
|
vehicle_handleServerKilled = {
|
||||||
private["_unit","_killer"];
|
private["_unit","_killer"];
|
||||||
_unit = _this select 0;
|
_unit = _this select 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user