mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-04 15:22:53 +03:00
Fix death cam height and rare duplicate weapon error
Vanilla commit:
1e01536fa7
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
private ["_amount","_item","_pos","_nearByPile","_holder","_type"];
|
||||
private ["_amount","_item","_pos","_manualPos","_nearByPile","_holder","_type"];
|
||||
|
||||
//Radius to search for holder
|
||||
#define PILE_SEARCH_RADIUS 2
|
||||
@@ -8,11 +8,10 @@ private ["_amount","_item","_pos","_nearByPile","_holder","_type"];
|
||||
_item = _this select 0;
|
||||
_type = _this select 1;
|
||||
_amount = _this select 2;
|
||||
_manualPos = count _this > 3;
|
||||
_pos = if (_manualPos) then {_this select 3} else {player modeltoWorld PILE_OFFSET};
|
||||
_holder = objNull;
|
||||
|
||||
//Lets get the location of the player in the world
|
||||
_pos = player modeltoWorld PILE_OFFSET;
|
||||
|
||||
//Check if a holder is close by the player.
|
||||
_nearByPile= nearestObjects [_pos, ["WeaponHolder","WeaponHolderBase"],PILE_SEARCH_RADIUS];
|
||||
|
||||
@@ -23,13 +22,15 @@ if (count _nearByPile == 0) then {
|
||||
//Found a near by weapon holder lets select it.
|
||||
_holder = _nearByPile select 0;
|
||||
|
||||
//check to make sure the player can see the selected weapon holder.
|
||||
_objects = lineIntersectsWith [(_holder modeltoWorld PILE_OFFSET), _pos, player, _holder, true];
|
||||
|
||||
//Can you see the current selected weapon holder
|
||||
if ((count _objects) > 0) then {
|
||||
//Unable to see the current selected weapon holder within the radius lets create a new one.
|
||||
_holder = createVehicle ["WeaponHolder", _pos, [], 0, "CAN_COLLIDE"];
|
||||
if (!_manualPos) then {
|
||||
//check to make sure the player can see the selected weapon holder.
|
||||
_objects = lineIntersectsWith [(_holder modeltoWorld PILE_OFFSET), _pos, player, _holder, true];
|
||||
|
||||
//Can you see the current selected weapon holder
|
||||
if (count _objects > 0) then {
|
||||
//Unable to see the current selected weapon holder within the radius lets create a new one.
|
||||
_holder = createVehicle ["WeaponHolder", _pos, [], 0, "CAN_COLLIDE"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user