From 96ddc8ff62e6c6ab6c0e890f67827abb76fe96fb Mon Sep 17 00:00:00 2001 From: icomrade Date: Thu, 21 Jul 2016 16:20:41 -0400 Subject: [PATCH] Add player to plot management by default + Some minor private array cleanup --- SQF/dayz_code/actions/modular_build.sqf | 7 +++++++ SQF/dayz_code/actions/player_build.sqf | 7 +++++++ SQF/dayz_code/actions/plotManagement/plotNearbyHumans.sqf | 7 +++---- SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf | 3 +-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/SQF/dayz_code/actions/modular_build.sqf b/SQF/dayz_code/actions/modular_build.sqf index 0564e3997..6780f763c 100644 --- a/SQF/dayz_code/actions/modular_build.sqf +++ b/SQF/dayz_code/actions/modular_build.sqf @@ -544,10 +544,17 @@ if (_canBuild select 0) then { if (DZE_permanentPlot) then { _tmpbuilt setVariable ["ownerPUID",_playerUID,true]; PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,_playerUID, _vector], []]; + if (_canBuild select 1) then { + _tmpbuilt setVariable ["plotfriends", [[([player] call FNC_GetPlayerUID),(name player)]], true]; + PVDZ_veh_Save = [_tmpbuilt,"gear"]; + }; } else { PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location, _vector],[]]; }; publicVariableServer "PVDZ_obj_Publish"; + if (!isNil "PVDZ_veh_Save") then { + publicVariableServer "PVDZ_veh_Save"; + }; }; }; } else { //if magazine was not removed, cancel publish diff --git a/SQF/dayz_code/actions/player_build.sqf b/SQF/dayz_code/actions/player_build.sqf index 5bcca8850..7e2806dba 100644 --- a/SQF/dayz_code/actions/player_build.sqf +++ b/SQF/dayz_code/actions/player_build.sqf @@ -453,10 +453,17 @@ if (_canBuild select 0) then { if (DZE_permanentPlot) then { _tmpbuilt setVariable ["ownerPUID",_playerUID,true]; PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,_playerUID],_classname]; + if (_canBuild select 1) then { + _tmpbuilt setVariable ["plotfriends", [[([player] call FNC_GetPlayerUID),(name player)]], true]; + PVDZ_veh_Save = [_tmpbuilt,"gear"]; + }; } else { PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location],[]]; }; publicVariableServer "PVDZ_obj_Publish"; + if (!isNil "PVDZ_veh_Save") then { + publicVariableServer "PVDZ_veh_Save"; + }; }; }; } else { diff --git a/SQF/dayz_code/actions/plotManagement/plotNearbyHumans.sqf b/SQF/dayz_code/actions/plotManagement/plotNearbyHumans.sqf index 1ce2ecbaf..6a2a843c7 100644 --- a/SQF/dayz_code/actions/plotManagement/plotNearbyHumans.sqf +++ b/SQF/dayz_code/actions/plotManagement/plotNearbyHumans.sqf @@ -1,12 +1,11 @@ -private ["_close"]; +private ["_closePeople","_friendUID","_friendName"]; lbClear 7001; -_closePeople = player nearEntities ["CAManBase", 10]; -if (!DZE_plotManagementMustBeClose) then {_closePeople = playableUnits}; +if (!DZE_plotManagementMustBeClose) then {_closePeople = playableUnits;} else {_closePeople = player nearEntities ["CAManBase", 10];}; Humans = []; { if (isPlayer _x) then { _friendUID = [_x] call FNC_GetPlayerUID; - _friendName = name _x; + _friendName = name _x; Humans = Humans + [[_friendUID,_friendName]]; lbAdd [7001, _friendName]; }; diff --git a/SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf b/SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf index 91e20a435..8580118a1 100644 --- a/SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf +++ b/SQF/dayz_code/actions/plotManagement/plotRemoveFriend.sqf @@ -1,5 +1,4 @@ -private ["_list","_plots","_thePlot","_friends"]; - +private ["_pos","_plots","_thePlot","_friends","_toRemove","_newList"]; _pos = _this select 0; if (_pos < 0) exitWith {}; _plots = nearestObjects [[player] call FNC_getPos, ["Plastic_Pole_EP1_DZ"],15];