mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-14 04:02:37 +03:00
Vectoradd function zero divisor fix
This commit is contained in:
35
SQF/dayz_code/compile/BIS_fnc/fn_vectorAdd.sqf
Normal file
35
SQF/dayz_code/compile/BIS_fnc/fn_vectorAdd.sqf
Normal file
@@ -0,0 +1,35 @@
|
||||
scriptName "Functions\vectors\fn_vectorAdd.sqf";
|
||||
/************************************************************
|
||||
Vector Add
|
||||
From VBS1 Core, modified by Vilem (arbitrary no of dimensions dimensions)
|
||||
|
||||
<difference> = [<vector1>,<vector2>] call BIS_fnc_vectorAdd
|
||||
|
||||
Operand types:
|
||||
<difference>: array
|
||||
<vector1>: array
|
||||
<vector2>: array
|
||||
|
||||
Returns a vector that is the sum of <vector1> and <vector2>.
|
||||
|
||||
************************************************************/
|
||||
|
||||
private["_p1","_p2","_return","_i"];
|
||||
|
||||
_p1 = _this select 0;
|
||||
_p2 = _this select 1;
|
||||
|
||||
if ((count _p1) != (count _p2)) then {textLogFormat ["BIS_FNC Error: vectors not of same size"]};
|
||||
|
||||
_return = [];
|
||||
_i = 0;
|
||||
{
|
||||
if(count(_p2) <= _i) then {
|
||||
_return = _return + [_x + (_p2 select _i)];
|
||||
} else {
|
||||
_return = _return + [_x];
|
||||
};
|
||||
_i = _i + 1;
|
||||
} forEach _p1;
|
||||
|
||||
_return
|
||||
@@ -722,7 +722,8 @@ if (!isDedicated) then {
|
||||
progressLoadingScreen 0.8;
|
||||
|
||||
//Both
|
||||
BIS_fnc_selectRandom = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_selectRandom.sqf"; //Checks which actions for nearby casualty
|
||||
BIS_fnc_selectRandom = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_selectRandom.sqf"; //Checks which actions for nearby casualty
|
||||
BIS_fnc_vectorAdd = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\BIS_fnc\fn_vectorAdd.sqf"; //Checks which actions for nearby casualty
|
||||
fnc_buildWeightedArray = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_buildWeightedArray.sqf"; //Checks which actions for nearby casualty
|
||||
fnc_usec_damageVehicle = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandlerVehicle.sqf"; //Event handler run on damage
|
||||
zombie_initialize = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\zombie_init.sqf";
|
||||
|
||||
Reference in New Issue
Block a user