Skip to content

Commit

Permalink
Add near player check to fix dupe
Browse files Browse the repository at this point in the history
Thanks Twist for the heads up
  • Loading branch information
oiad committed Jan 16, 2020
1 parent 22887cc commit 1c91875
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion DayZ_Epoch_11.Chernarus/scripts/buryActions.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Bury/Butcher body script by salival (https://github.com/oiad)
*/

private ["_action","_backPackMag","_backPackWpn","_crate","_corpse","_cross","_gain","_humanity","_humanityAmount","_isBury","_grave","_name","_backPack","_position","_sound","_notOnRoad"];
private ["_action","_backPackMag","_backPackWpn","_crate","_corpse","_cross","_gain","_humanity","_humanityAmount","_isBury","_grave","_name","_playerNear","_backPack","_position","_sound","_notOnRoad"];

if (dayz_actionInProgress) exitWith {localize "str_player_actionslimit" call dayz_rollingMessages;};
dayz_actionInProgress = true;
Expand All @@ -15,6 +15,9 @@ _notOnRoad = false; // Restrict burying/butchering on roads?

if (isNull _corpse) exitWith {dayz_actionInProgress = false; systemChat "cursorTarget isNull!";};

_playerNear = {isPlayer _x} count (([_corpse] call FNC_GetPos) nearEntities ["CAManBase", 10]) > 1;
if (_playerNear) exitWith {dayz_actionInProgress = false; localize "str_pickup_limit_5" call dayz_rollingMessages;};

player removeAction s_player_bury_human;
s_player_bury_human = -1;
player removeAction s_player_butcher_human;
Expand Down

0 comments on commit 1c91875

Please sign in to comment.