From 914b37a4133cb8bba65a3459c1beaea3ada99073 Mon Sep 17 00:00:00 2001 From: ebaydayz Date: Thu, 19 May 2016 13:10:20 -0400 Subject: [PATCH] Pass cursorTarget to maintain_area.sqf CursorTarget should always be passed from fn_selfActions, not reacquired in action scripts. This is to ensure the same object is referenced. Plot Management maintain_area is called from the dialog button, not fn_selfactions. --- SQF/dayz_code/actions/maintain_area.sqf | 4 ++-- SQF/dayz_code/actions/plotManagement/maintain_area.sqf | 2 +- SQF/dayz_code/actions/plotManagement/maintain_areaSC.sqf | 2 +- SQF/dayz_code/compile/fn_selfActions.sqf | 4 ++-- SQF/dayz_code/config.cpp | 2 -- SQF/dayz_server/compile/server_updateObject.sqf | 4 ---- SQF/dayz_server/system/server_monitor.sqf | 4 ---- 7 files changed, 6 insertions(+), 16 deletions(-) diff --git a/SQF/dayz_code/actions/maintain_area.sqf b/SQF/dayz_code/actions/maintain_area.sqf index 42d4eddcb..447593839 100644 --- a/SQF/dayz_code/actions/maintain_area.sqf +++ b/SQF/dayz_code/actions/maintain_area.sqf @@ -9,7 +9,7 @@ s_player_maintain_area = 1; player removeAction s_player_maintain_area_preview; s_player_maintain_area_preview = 1; -_target = cursorTarget; // Plastic_Pole_EP1_DZ +_target = (_this select 3) select 1; // Plastic_Pole_EP1_DZ _objectClasses = DZE_maintainClasses; _range = DZE_maintainRange; // set the max range for the maintain area @@ -54,7 +54,7 @@ switch true do { -_option = _this select 3; +_option = (_this select 3) select 0; switch _option do { case "maintain": { diff --git a/SQF/dayz_code/actions/plotManagement/maintain_area.sqf b/SQF/dayz_code/actions/plotManagement/maintain_area.sqf index 5f4ae523e..3f2e033c0 100644 --- a/SQF/dayz_code/actions/plotManagement/maintain_area.sqf +++ b/SQF/dayz_code/actions/plotManagement/maintain_area.sqf @@ -9,7 +9,7 @@ s_player_maintain_area = 1; player removeAction s_player_maintain_area_preview; s_player_maintain_area_preview = 1; -_target = cursorTarget; +_target = nearestObject [[player] call FNC_getPos,"Plastic_Pole_EP1_DZ"]; _objectClasses = DZE_maintainClasses; _range = DZE_PlotPole select 0; diff --git a/SQF/dayz_code/actions/plotManagement/maintain_areaSC.sqf b/SQF/dayz_code/actions/plotManagement/maintain_areaSC.sqf index 32d3dc777..3e94b1f5e 100644 --- a/SQF/dayz_code/actions/plotManagement/maintain_areaSC.sqf +++ b/SQF/dayz_code/actions/plotManagement/maintain_areaSC.sqf @@ -9,7 +9,7 @@ s_player_maintain_area = 1; player removeAction s_player_maintain_area_preview; s_player_maintain_area_preview = 1; -_target = cursorTarget; +_target = nearestObject [[player] call FNC_getPos,"Plastic_Pole_EP1_DZ"]; _objectClasses = DZE_maintainClasses; _range = DZE_PlotPole select 0; diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index b691b36ff..71340f220 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -651,8 +651,8 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur }; } else { if (s_player_maintain_area < 0) then { - s_player_maintain_area = player addAction [format["%1",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, false]; - s_player_maintain_area_preview = player addAction [format["%1",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, false]; + s_player_maintain_area = player addAction [format["%1",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", ["maintain",_cursorTarget], 5, false]; + s_player_maintain_area_preview = player addAction [format["%1",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\maintain_area.sqf", ["preview",_cursorTarget], 5, false]; }; }; _plotDistance = (DZE_PlotPole select 0); diff --git a/SQF/dayz_code/config.cpp b/SQF/dayz_code/config.cpp index addaed267..69f4721ca 100644 --- a/SQF/dayz_code/config.cpp +++ b/SQF/dayz_code/config.cpp @@ -113,7 +113,5 @@ class CfgAddons #include "Configs\RscDisplay\deathboards.hpp" #include "Configs\CfgExtra\snappoints.hpp" #include "external\R3F_Realism\R3F_Weight\R3F_CfgWeight.hpp" -// plotManagement // #include "Configs\RscDisplay\ZSCdefines.hpp" #include "Configs\RscDisplay\plotManagement.hpp" -// plotManagement // diff --git a/SQF/dayz_server/compile/server_updateObject.sqf b/SQF/dayz_server/compile/server_updateObject.sqf index c63e58143..1a013ccdd 100644 --- a/SQF/dayz_server/compile/server_updateObject.sqf +++ b/SQF/dayz_server/compile/server_updateObject.sqf @@ -69,15 +69,11 @@ _object_inventory = { if (_object isKindOf "TrapItems") then { _inventory = [["armed",_object getVariable ["armed",false]]]; } else { - // plotManagement // if( DZE_plotManagement && (typeOf (_object) == "Plastic_Pole_EP1_DZ") ) then { _inventory = _object getVariable ["plotfriends", []]; //We're replacing the inventory with UIDs for this item } else { - // plotManagement // _inventory = [getWeaponCargo _object, getMagazineCargo _object, getBackpackCargo _object]; - // plotManagement // }; - // plotManagement // }; _previous = str(_object getVariable["lastInventory",[]]); diff --git a/SQF/dayz_server/system/server_monitor.sqf b/SQF/dayz_server/system/server_monitor.sqf index cb2ea142d..0f1642906 100644 --- a/SQF/dayz_server/system/server_monitor.sqf +++ b/SQF/dayz_server/system/server_monitor.sqf @@ -176,11 +176,9 @@ if (_status == "ObjectStreamStart") then { _object setVariable ["ObjectID", _idKey, true]; _object setVariable ["OwnerPUID", _ownerPUID, true]; - // plotManagement // if( DZE_plotManagement && (typeOf (_object) == "Plastic_Pole_EP1_DZ") ) then { _object setVariable ["plotfriends", _inventory, true]; }; - // plotManagement // dayz_serverIDMonitor set [count dayz_serverIDMonitor,_idKey]; // Fix for leading zero issues on safe codes after restart @@ -211,9 +209,7 @@ if (_status == "ObjectStreamStart") then { clearWeaponCargoGlobal _object; clearMagazineCargoGlobal _object; clearBackpackCargoGlobal _object; - // plotManagement // if( (count _inventory > 0) && !(typeOf( _object) == "Plastic_Pole_EP1_DZ") ) then { - // plotManagement // if (_type in DZE_LockedStorage) then { _object setVariable ["WeaponCargo",(_inventory select 0),true]; _object setVariable ["MagazineCargo",(_inventory select 1),true];