From 3c27f76c7c7aed932fd1fb5da69b1ff0ec0bfef2 Mon Sep 17 00:00:00 2001 From: icomrade Date: Mon, 2 May 2016 23:06:50 -0400 Subject: [PATCH] use self actions to spawn plot radius, fixes #1566 --- SQF/dayz_code/actions/modular_build.sqf | 6 ++--- SQF/dayz_code/actions/player_build.sqf | 6 ++--- SQF/dayz_code/compile/fn_selfActions.sqf | 34 +++++++++++++----------- 3 files changed, 24 insertions(+), 22 deletions(-) diff --git a/SQF/dayz_code/actions/modular_build.sqf b/SQF/dayz_code/actions/modular_build.sqf index ed6fb283b..98684117b 100644 --- a/SQF/dayz_code/actions/modular_build.sqf +++ b/SQF/dayz_code/actions/modular_build.sqf @@ -441,9 +441,9 @@ if (_canBuild select 0) then { format[localize "str_build_01",_text] call dayz_rollingMessages; - if (_canBuild select 1) then { //if item was a plotpole, build a visual radius around it - [] spawn player_plotPreview; - }; + //if (_canBuild select 1) then { //if item was a plotpole, build a visual radius around it + //[] spawn player_plotPreview; //handled in fn_SelfActions now + //}; _tmpbuilt setVariable ["OEMPos",_location,true]; //store original location as a variable diff --git a/SQF/dayz_code/actions/player_build.sqf b/SQF/dayz_code/actions/player_build.sqf index 6e948419a..5ecbe5ce4 100644 --- a/SQF/dayz_code/actions/player_build.sqf +++ b/SQF/dayz_code/actions/player_build.sqf @@ -382,9 +382,9 @@ if (_canBuild select 0) then { format[localize "str_build_01",_text] call dayz_rollingMessages; - if (_canBuild select 1) then { - [] spawn player_plotPreview; - }; + //if (_canBuild select 1) then { + //[] spawn player_plotPreview; + //}; _tmpbuilt setVariable ["OEMPos",_location,true]; diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf index 548714d4f..7c7423229 100644 --- a/SQF/dayz_code/compile/fn_selfActions.sqf +++ b/SQF/dayz_code/compile/fn_selfActions.sqf @@ -655,19 +655,19 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur 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]; }; }; - if (DZE_plotforLife) then { - _plotDistance = (DZE_PlotPole select 0); - _PlotsmarkersNear = count (_cursorTarget nearEntities ["Land_coneLight", _PlotDistance]); - if (s_player_plot_boundary_on < 0) then { - If (_PlotsmarkersNear == 0 ) then{ - s_player_plot_boundary_on = player addAction ["Show plot boundary", "\z\addons\dayz_code\actions\A_Plot_for_Life\object_showPlotRadius.sqf", "", 1, false]; - }; - }; - if (s_player_plot_boundary_off < 0) then { - If (_PlotsmarkersNear > 0 ) then{ - s_player_plot_boundary_off = player addAction ["Remove plot boundary", "\z\addons\dayz_code\actions\A_Plot_for_Life\object_removePlotRadius.sqf", "", 1, false]; - }; + _plotDistance = (DZE_PlotPole select 0); + _PlotsmarkersNear = count (_cursorTarget nearEntities ["Land_coneLight", _PlotDistance]); + if (s_player_plot_boundary_on < 0) then { + If (_PlotsmarkersNear == 0 ) then{ + s_player_plot_boundary_on = player addAction ["Show plot boundary", "\z\addons\dayz_code\actions\A_Plot_for_Life\object_showPlotRadius.sqf", "", 1, false]; }; + }; + if (s_player_plot_boundary_off < 0) then { + If (_PlotsmarkersNear > 0 ) then{ + s_player_plot_boundary_off = player addAction ["Remove plot boundary", "\z\addons\dayz_code\actions\A_Plot_for_Life\object_removePlotRadius.sqf", "", 1, false]; + }; + }; + if (DZE_plotforLife) then { if (s_player_plot_take_ownership < 0) then { if (DZE_PlotOwnership) then { _isowner = [player, _cursorTarget, DZE_plotManagement] call FNC_check_owner; //compile also calls dze_getPlotFriends and lists s_player_plotManagement friendlies @@ -1054,12 +1054,14 @@ if (!isNull _cursorTarget && !_inVehicle && !_isPZombie && (player distance _cur }; } else { //Engineering - - // plotManagement // + player removeAction s_player_plot_boundary_on; + s_player_plot_boundary_on = -1; + player removeAction s_player_plot_boundary_off; + s_player_plot_boundary_off = -1; + player removeAction s_player_plot_take_ownership; + s_player_plot_take_ownership = -1; player removeAction s_player_plotManagement; s_player_plotManagement = -1; - // plotManagement // - {dayz_myCursorTarget removeAction _x} count s_player_repairActions;s_player_repairActions = []; player removeAction s_player_repair_crtl; s_player_repair_crtl = -1;