mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Remove ObjectID and ObjectUID from PVDZE_maintainArea
This also fixes non maintained safes if they were open when the player maintains the base.
This commit is contained in:
@@ -20,7 +20,7 @@ Please see configVariables.sqf for the value of gems (DZE_GemWorthArray) and the
|
||||
if (dayz_actionInProgress) exitWith {localize "STR_EPOCH_ACTIONS_2" call dayz_rollingMessages;};
|
||||
dayz_actionInProgress = true;
|
||||
|
||||
private ["_maintain","_req","_objectID","_objectUID","_target","_objects","_requirements","_count","_objects_filtered","_message1","_message2","_option","_line1","_line2","_plotDialog"];
|
||||
private ["_maintain","_req","_target","_objects","_requirements","_count","_objects_filtered","_message1","_message2","_option","_line1","_line2","_plotDialog"];
|
||||
|
||||
player removeAction s_player_maintain_area;
|
||||
s_player_maintain_area = 1;
|
||||
@@ -56,10 +56,10 @@ _maintain = {
|
||||
_itemText = _requirements select 1;
|
||||
|
||||
_enoughMoney = false;
|
||||
_moneyInfo = [false, [], [], [], 0];
|
||||
_wealth = player getVariable[(["cashMoney","globalMoney"] select Z_persistentMoney),0];
|
||||
_moneyInfo = [false, [], [], [], 0];
|
||||
|
||||
if (Z_SingleCurrency) then {
|
||||
_wealth = player getVariable[(["cashMoney","globalMoney"] select Z_persistentMoney),0];
|
||||
_enoughMoney = (_wealth >= _amount);
|
||||
} else {
|
||||
Z_Selling = false; // Initialize gem currency before Z_canAfford.
|
||||
@@ -83,7 +83,7 @@ _maintain = {
|
||||
if (_success) then {
|
||||
["Working",0,[100,15,10,0]] call dayz_NutritionSystem;
|
||||
|
||||
PVDZE_maintainArea = [player,1,_this select 0];
|
||||
PVDZE_maintainArea = [netID player,1,_this select 0];
|
||||
publicVariableServer "PVDZE_maintainArea";
|
||||
|
||||
if (Z_SingleCurrency) then {
|
||||
@@ -119,9 +119,7 @@ _maintain = {
|
||||
|
||||
{
|
||||
if (damage _x >= DZE_DamageBeforeMaint) then {
|
||||
_objectUID = _x getVariable ["ObjectUID","0"];
|
||||
_objectID = _x getVariable ["ObjectID","0"];
|
||||
_objects_filtered set [count _objects_filtered, [_x, _objectID, _objectUID]];
|
||||
_objects_filtered set [count _objects_filtered,netID _x];
|
||||
_count = _count + 1;
|
||||
};
|
||||
} count _objects;
|
||||
@@ -140,9 +138,7 @@ call {
|
||||
_count = 0;
|
||||
_objects_filtered = [];
|
||||
{
|
||||
_objectUID = _x getVariable ["ObjectUID","0"];
|
||||
_objectID = _x getVariable ["ObjectID","0"];
|
||||
_objects_filtered set [count _objects_filtered, [_x, _objectID, _objectUID]];
|
||||
_objects_filtered set [count _objects_filtered,netID _x];
|
||||
_count = _count + 1;
|
||||
} count _objects;
|
||||
|
||||
|
||||
@@ -16,16 +16,6 @@ player removeAction s_player_maint_build;
|
||||
s_player_maint_build = 1;
|
||||
|
||||
local _obj = _this select 3;
|
||||
|
||||
local _objectID = _obj getVariable ["ObjectID","0"];
|
||||
local _objectUID = _obj getVariable ["ObjectUID","0"];
|
||||
|
||||
if (_objectID == "0" && _objectUID == "0") exitWith {
|
||||
dayz_actionInProgress = false;
|
||||
s_player_maint_build = -1;
|
||||
localize "str_epoch_player_50" call dayz_rollingMessages; // Not setup yet.
|
||||
};
|
||||
|
||||
local _classname = typeOf _obj;
|
||||
|
||||
// Find next maintain
|
||||
@@ -103,7 +93,7 @@ if (_proceed) then {
|
||||
|
||||
format[localize "STR_EPOCH_ACTIONS_4" ,1] call dayz_rollingMessages; // You have maintained %1 building parts.
|
||||
|
||||
PVDZE_maintainArea = [player, 2, [_obj, _objectID, _objectUID]];
|
||||
PVDZE_maintainArea = [netID player, 2, [netID _obj]];
|
||||
publicVariableServer "PVDZE_maintainArea";
|
||||
|
||||
} else {
|
||||
|
||||
@@ -299,7 +299,7 @@ if (!isDedicated) then {
|
||||
DZE_LockboxesUnlocked = ["LockboxStorage","LockboxStorage2","LockboxStorageWinter","LockboxStorageWinter2"];
|
||||
DZE_REPLACE_WEAPONS = [["Crossbow","DMR","M14_EP1","SVD","SVD_CAMO","M4SPR","VSS_vintorez"],["Crossbow_DZ","DMR_DZ","M14_CCO_DZ","SVD_PSO1_DZ","SVD_PSO1_Gh_DZ","M4SPR_DZE","VSS_vintorez_DZE"]];
|
||||
DZE_replaceMagazines = [["vil_20Rnd_762x51_G3"],["vil_20Rnd_762x51_G3"]];
|
||||
DZE_maintainClasses = DayZ_SafeObjects;
|
||||
DZE_maintainClasses = DayZ_SafeObjects + DZE_UnLockedStorage;
|
||||
DZE_fueltruckarray = ["UralRefuel_TK_EP1_DZ","UralRefuel_TK_EP1_DZE1","UralRefuel_TK_EP1_DZE2","UralRefuel_TK_EP1_DZE3","UralRefuel_TK_EP1_DZE4","MtvrRefuel_DES_EP1_DZ","MtvrRefuel_DES_EP1_DZE1","MtvrRefuel_DES_EP1_DZE2","MtvrRefuel_DES_EP1_DZE3","MtvrRefuel_DES_EP1_DZE4","V3S_Refuel_TK_GUE_EP1_DZ","V3S_Refuel_TK_GUE_EP1_DZE1","V3S_Refuel_TK_GUE_EP1_DZE2","V3S_Refuel_TK_GUE_EP1_DZE3","V3S_Refuel_TK_GUE_EP1_DZE4","MtvrRefuel_DZ","MtvrRefuel_DZE1","MtvrRefuel_DZE2","MtvrRefuel_DZE3","MtvrRefuel_DZE4","KamazRefuel_DZ","KamazRefuel_DZE1","KamazRefuel_DZE2","KamazRefuel_DZE3","KamazRefuel_DZE4","T810A_ACR_REFUEL_DES_DZE","T810A_ACR_REFUEL_DES_DZE1","T810A_ACR_REFUEL_DES_DZE2","T810A_ACR_REFUEL_DES_DZE3","T810A_ACR_REFUEL_DES_DZE4","T810A_ACR_REFUEL_DZE","T810A_ACR_REFUEL_DZE1","T810A_ACR_REFUEL_DZE2","T810A_ACR_REFUEL_DZE3","T810A_ACR_REFUEL_DZE4","UralRefuel_INS_DZE","UralRefuel_INS_DZE1","UralRefuel_INS_DZE2","UralRefuel_INS_DZE3","UralRefuel_INS_DZE4","UralRefuel_CDF_DZE","UralRefuel_CDF_DZE1","UralRefuel_CDF_DZE2","UralRefuel_CDF_DZE3","UralRefuel_CDF_DZE4"];
|
||||
DZE_HeliAllowToTow = ["hilux1_civil_1_open","HMMWV_Base","Lada_base","Offroad_DSHKM_base","Pickup_PK_base","SkodaBase","tractor","VWGolf","Volha_TK_CIV_Base_EP1","S1203_TK_CIV_EP1","SUV_Base_EP1","ArmoredSUV_Base_PMC","UAZ_Base","LandRover_Base","Ship"];
|
||||
DZE_isDestroyableStorage = DZE_isNewStorage + DZE_Stashes;
|
||||
|
||||
@@ -1,38 +1,21 @@
|
||||
/* Maintain Area - written by Skaronator */
|
||||
/*
|
||||
1: PVDZE_maintainArea = [player,1,[[Object, _objectID, _objectUID],[Object, _objectID, _objectUID]...etc]];
|
||||
2: PVDZE_maintainArea = [player,2,[Object, _objectID, _objectUID]];
|
||||
1: PVDZE_maintainArea = [netID player,1,[netID Object,netID Object,netID Object,...etc]];
|
||||
2: PVDZE_maintainArea = [netID player,2,[netID Object]];
|
||||
*/
|
||||
|
||||
private ["_player","_option","_obj","_name","_objectsInfo","_UID","_ID","_key"];
|
||||
|
||||
_player = _this select 0;
|
||||
_player = objectfromNetID(_this select 0);
|
||||
_option = _this select 1;
|
||||
_objectsInfo = _this select 2;
|
||||
|
||||
if (_option == 1) then {
|
||||
{
|
||||
_obj = _x select 0;
|
||||
_ID = _x select 1;
|
||||
_UID = _x select 2;
|
||||
if (_ID == "0") then {
|
||||
if (_UID != "0") then {
|
||||
_obj setDamage 0;
|
||||
_key = format["CHILD:397:%1:", _UID];
|
||||
_key call server_hiveWrite;
|
||||
};
|
||||
} else {
|
||||
_obj setDamage 0;
|
||||
_key = format["CHILD:396:%1:", _ID];
|
||||
_key call server_hiveWrite;
|
||||
};
|
||||
} count _objectsInfo;
|
||||
_name = if (alive _player) then { name _player; } else { "Dead Player"; };
|
||||
diag_log format ["MAINTAIN AREA BY %1 - %2 Objects at %3, Grid: %4", _name, (count _objectsInfo), (getPosATL _player), mapGridPosition(getPosATL _player)];
|
||||
} else {
|
||||
_obj = _objectsInfo select 0;
|
||||
_ID = _objectsInfo select 1;
|
||||
_UID = _objectsInfo select 2;
|
||||
_obj = objectfromNetID _x;
|
||||
_ID = _obj getVariable ["ObjectID","0"];
|
||||
_UID = _obj getVariable ["ObjectUID","0"];
|
||||
|
||||
if (_ID == "0") then {
|
||||
if (_UID != "0") then {
|
||||
_obj setDamage 0;
|
||||
@@ -44,4 +27,23 @@ if (_option == 1) then {
|
||||
_key = format["CHILD:396:%1:", _ID];
|
||||
_key call server_hiveWrite;
|
||||
};
|
||||
} count _objectsInfo;
|
||||
_name = if (alive _player) then { name _player; } else { "Dead Player"; };
|
||||
diag_log format ["MAINTAIN AREA BY %1 - %2 Objects at %3, Grid: %4", _name, (count _objectsInfo), (getPosATL _player), mapGridPosition(getPosATL _player)];
|
||||
} else {
|
||||
_obj = objectfromNetID(_objectsInfo select 0);
|
||||
_ID = _obj getVariable ["ObjectID","0"];
|
||||
_UID = _obj getVariable ["ObjectUID","0"];
|
||||
|
||||
if (_ID == "0") then {
|
||||
if (_UID != "0") then {
|
||||
_obj setDamage 0;
|
||||
_key = format["CHILD:397:%1:", _UID];
|
||||
_key call server_hiveWrite;
|
||||
};
|
||||
} else {
|
||||
_obj setDamage 0;
|
||||
_key = format["CHILD:396:%1:", _ID];
|
||||
_key call server_hiveWrite;
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user