mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-18 01:30:26 +03:00
Merge pull request #556 from zabn/master
Vectoradd function zero divisor fix
This commit is contained in:
@@ -875,7 +875,9 @@ class RscDisplayGear
|
||||
{
|
||||
idd = 106;
|
||||
enableDisplay = 1;
|
||||
onLoad = "_this call fn_gearMenuChecks;[] spawn object_monitorGear; {player removeMagazines _x} forEach MeleeMagazines; call gear_ui_init; if (isNil('IGUI_GEAR_activeFilter')) then { IGUI_GEAR_activeFilter = 0;}; private ['_dummy']; _dummy = [_this,'initDialog'] call compile preprocessFile '\ca\ui\scripts\handleGear.sqf'; _dummy = [_this,'onLoad'] execVM '\ca\ui\scripts\handleGear.sqf'; _dummy;";
|
||||
onUnload = "call player_gearSync; call dayz_forceSave;";
|
||||
|
||||
class controls
|
||||
{
|
||||
class CA_Filter_Icon: RscPicture
|
||||
|
||||
@@ -93,18 +93,26 @@ if (count(_findNearestTree) >= 1) then {
|
||||
|
||||
if (_proceed) then {
|
||||
|
||||
_invResult = false;
|
||||
_i = 0;
|
||||
for "_x" from 1 to _countOut do {
|
||||
player addMagazine _itemOut;
|
||||
_invResult = [player,_itemOut] call BIS_fnc_invAdd;
|
||||
if(_invResult) then {
|
||||
_i = _i + 1;
|
||||
};
|
||||
};
|
||||
|
||||
if(_i != 0) then {
|
||||
// chop down tree
|
||||
if("" == typeOf _tree) then {
|
||||
_tree setDamage 1;
|
||||
};
|
||||
//diag_log format["DEBUG TREE DAMAGE: %1", _tree];
|
||||
|
||||
cutText [format["\n\n%1 of %2 has been successfully added to your inventory.", _countOut,_itemOut], "PLAIN DOWN"];
|
||||
|
||||
cutText [format["\n\n%1 of %2 has been successfully added to your inventory.", _i,_itemOut], "PLAIN DOWN"];
|
||||
} else {
|
||||
cutText [format["\n\n%1 of %2 could not be added to your inventory. (not enough room?)", _i,_itemOut], "PLAIN DOWN"];
|
||||
};
|
||||
} else {
|
||||
r_interrupt = false;
|
||||
if (vehicle player == player) then {
|
||||
|
||||
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
|
||||
7
SQF/dayz_code/compile/fn_gearMenuChecks.sqf
Normal file
7
SQF/dayz_code/compile/fn_gearMenuChecks.sqf
Normal file
@@ -0,0 +1,7 @@
|
||||
disableSerialization;
|
||||
_display = (_this select 0);
|
||||
_close = {locked _x} count (nearestObjects [player, ["AllVehicles"], 5]) > 0;
|
||||
|
||||
if(_close) then {
|
||||
_display closeDisplay 1;
|
||||
};
|
||||
@@ -56,6 +56,7 @@ if (!isDedicated) then {
|
||||
player_alertZombies = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_alertZombies.sqf";
|
||||
player_fireMonitor = compile preprocessFileLineNumbers "\z\addons\dayz_code\system\fire_monitor.sqf";
|
||||
player_friendliesCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\player_friendliesCheck.sqf";
|
||||
fn_gearMenuChecks = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_gearMenuChecks.sqf";
|
||||
|
||||
//Objects
|
||||
object_roadFlare = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf";
|
||||
@@ -722,7 +723,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