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.
This commit is contained in:
ebaydayz
2016-05-19 13:10:20 -04:00
parent 1a238d1719
commit 914b37a413
7 changed files with 6 additions and 16 deletions

View File

@@ -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": {

View File

@@ -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;

View File

@@ -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;

View File

@@ -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["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTAREA"], "\z\addons\dayz_code\actions\maintain_area.sqf", "maintain", 5, false];
s_player_maintain_area_preview = player addAction [format["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\maintain_area.sqf", "preview", 5, false];
s_player_maintain_area = player addAction [format["<t color='#ff0000'>%1</t>",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["<t color='#ff0000'>%1</t>",localize "STR_EPOCH_ACTIONS_MAINTPREV"], "\z\addons\dayz_code\actions\maintain_area.sqf", ["preview",_cursorTarget], 5, false];
};
};
_plotDistance = (DZE_PlotPole select 0);

View File

@@ -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 //

View File

@@ -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",[]]);

View File

@@ -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];