Remove fn_upgradeActions

Vanilla commit:

02bc22f325
This commit is contained in:
ebaydayz
2017-01-26 21:19:17 -05:00
parent 6c2f5448e1
commit c7b71f93f0
10 changed files with 24 additions and 125 deletions

View File

@@ -1,9 +1,9 @@
private ["_cursorTarget","_onLadder","_isWater","_alreadyRemoving","_characterID","_objectID","_objectUID","_ownerArray","_dir",
"_realObjectStillThere","_upgrade","_entry","_parent","_requiredParts","_requiredTools","_model","_toolsOK","_displayname",
"_whpos","_i","_wh","_object","_vector","_dis","__FILE__","_puid","_variables"];
"_whpos","_wh","_object","_vector","_dis","_puid","_variables"];
_cursorTarget = _this select 3;
_cursorTarget = _this;
// ArmaA2 bug workaround: sometimes the object is null
if ((isNil "_cursorTarget") or {(isNull _cursorTarget)}) then {
@@ -13,9 +13,7 @@ if ((isNil "_cursorTarget") or {(isNull _cursorTarget)}) then {
if(isNull _cursorTarget) exitWith { localize "str_disassembleNoOption" call dayz_rollingMessages; };
//Remove action Menu
player removeAction s_player_disassembly;
s_player_disassembly = -1;
if (player getVariable["alreadyBuilding",0] == 1) exitWith { localize "str_upgradeInProgress" call dayz_rollingMessages; };
//Normal blocked stuff
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;

View File

@@ -7,7 +7,7 @@
private ["_isMedic","_cursorTarget","_item","_classname","_displayname","_requiredTools","_requiredParts","_onLadder","_isWater","_upgradeParts","_startMaintenance","_dis","_sfx","_started","_finished","_animState","_isRefuel"];
_cursorTarget = _this select 3;
_cursorTarget = _this;
// ArmaA2 bug workaround: sometimes the object is null
if ((isNil "_cursorTarget") or {(isNull _cursorTarget)}) then {
@@ -19,9 +19,9 @@ if(isNull _cursorTarget) exitWith {
localize "str_maintenanceNoOption" call dayz_rollingMessages;
};
//Remove action Menu
player removeAction s_player_maintenance;
s_player_maintenance = -1;
if (player getVariable["alreadyBuilding",0] == 1) exitWith {
localize "str_upgradeInProgress" call dayz_rollingMessages;
};
//Item
_item = typeof _cursorTarget;

View File

@@ -9,12 +9,11 @@
};
*/
private ["_objclass","_cursorTarget","_item","_classname","_requiredTools","_requiredParts","_upgrade","_upgradeConfig",
private ["_cursorTarget","_item","_classname","_requiredTools","_requiredParts","_upgrade","_upgradeConfig",
"_upgradeDisplayname","_onLadder","_isWater","_upgradeParts","_startUpgrade","_missingPartsConfig","_textMissingParts","_dis",
"_sfx","_ownerID","_objectID","_objectUID","_alreadyupgrading","_dir","_weapons","_magazines","_backpacks","_object",
"_objWpnTypes","_objWpnQty","_countr","_itemName","_vector"];
_objclass = _this;
_cursorTarget = _this select 3;
_item = typeof _cursorTarget;
@@ -129,11 +128,8 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
player playActionNow "Medic";
//remove old tent
_activatingPlayer = player;
PVDZ_obj_Destroy = [_objectID,_objectUID, _activatingPlayer];
PVDZ_obj_Destroy = [_objectID,_objectUID,player];
publicVariableServer "PVDZ_obj_Destroy";
if (isServer) then { PVDZ_obj_Destroy call server_deleteObj; };
deleteVehicle _cursorTarget;
// remove parts from players inventory before creation of new tent.
@@ -186,8 +182,13 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
uiSleep 3;
//publish new tent
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir, _pos],[_weapons,_magazines,_backpacks]];
//publish new tent
if (DZE_permanentPlot) then {
_object setVariable ["ownerPUID",dayz_playerUID,true];
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir, _pos, dayz_playerUID],[_weapons,_magazines,_backpacks]];
} else {
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir, _pos],[_weapons,_magazines,_backpacks]];
};
publicVariableServer "PVDZ_obj_Publish";
diag_log [diag_ticktime, __FILE__, "New Networked object, request to save to hive. PVDZ_obj_Publish:", PVDZ_obj_Publish];

View File

@@ -15,9 +15,7 @@ private ["_cursorTarget","_type","_class","_requiredTools","_requiredParts","_up
"_upgradeClass","_onLadder","_isWater","_ok","_missing","_upgradeParts","_dis","_characterID","_objectID","_objectUID",
"_ownerArray","_ownerPasscode","_dir","_vector","_object","_puid","_clanArray","_wh","_variables"];
//systemchat str _this;
_cursorTarget = _this select 3;
_cursorTarget = _this;
// ArmaA2 bug workaround: sometimes the object is null
if ((isNil "_cursorTarget") or {(isNull _cursorTarget)}) then {
_cursorTarget = nearestObjects [ player modelToWorld [0,1.5,0] , ["DZ_buildables","BuiltItems"], 1.5];
@@ -25,9 +23,6 @@ if ((isNil "_cursorTarget") or {(isNull _cursorTarget)}) then {
};
if (isNull _cursorTarget) exitWith {};
player removeAction s_player_building;
s_player_building = -1;
_type = typeof _cursorTarget;
_class = configFile >> "CfgVehicles" >> _type;
_requiredTools = getArray (_class >> "Upgrade" >> "requiredTools");
@@ -131,8 +126,7 @@ _object setVariable ["characterID",_characterID,true];
//remove old object
deleteVehicle _cursorTarget;
_activatingPlayer = player;
PVDZ_obj_Destroy = [_objectID,_objectUID, _activatingPlayer];
PVDZ_obj_Destroy = [_objectID,_objectUID,player];
publicVariableServer "PVDZ_obj_Destroy";
// create a weaponholder with dismissed parts

View File

@@ -1,8 +1,8 @@
#define CAN_DO (!r_drag_sqf && !r_player_unconscious && getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder") != 1)
//#define HAS_TOOLBOX ("ItemToolbox" in items player)
#define HAS_TOOLBOX ("ItemToolbox" in items player)
#define IN_VEHICLE (vehicle player != player)
#define IS_ALIVE (damage _object < 1)
//#define IS_DAMAGED (damage _object > 0)
#define IS_DAMAGED (damage _object > 0)
#define IS_PZOMBIE (player isKindOf "PZombie_VB")
/*
@@ -24,9 +24,9 @@ _show = switch _action do {
//case "Repair": {IS_ALIVE && !IN_VEHICLE && CAN_DO && _object != dayz_myCursorTarget && HAS_TOOLBOX};
//case "Salvage": {IS_ALIVE && !IN_VEHICLE && CAN_DO && _object != dayz_myCursorTarget && HAS_TOOLBOX && (DZE_salvageLocked or !locked _object)};
//Built Items (Fence,Gates)
//case "ObjectUpgrade": {!(_object getVariable['BuildLock',false])};
//case "ObjectMaintenance": {!(_object getVariable['Maintenance',false]) OR IS_DAMAGED};
//case "ObjectDisassembly": {((getPlayerUID player) in _object getVariable ["ownerArray",[]]) && (isClass (configFile >> "CfgVehicles" >> (typeof _object) >> "Disassembly")) && HAS_TOOLBOX};
//case "ObjectUpgrade": {CAN_DO && !IN_VEHICLE && !(_object getVariable["BuildLock",false])};
//case "ObjectMaintenance": {CAN_DO && !IN_VEHICLE && (_object getVariable["Maintenance",false] or IS_DAMAGED)};
//case "ObjectDisassembly": {CAN_DO && !IN_VEHICLE && HAS_TOOLBOX && !(_object getVariable["BuildLock",false]) && ((getPlayerUID player in _object getVariable["ownerArray",[]]) or (count (_object getVariable["ownerArray",[]]) == 0) or (typeOf _object in ["WoodenFence_1_foundation","WoodenGate_foundation"]))};
default {false};
};