Fix some issues with traps

Removed two unused files.

Vanilla commits:

42e72463a3

02726fb192

6a7c53ebcf

1fb6308995

9543ea057f
This commit is contained in:
ebayShopper
2017-03-20 15:53:35 -04:00
parent 100f9f5da8
commit e38f47375c
20 changed files with 111 additions and 117 deletions

View File

@@ -6,7 +6,6 @@ _type = _array select 0;
_classname = _array select 1;
_holder = _array select 2;
if (player distance _holder > 3) exitwith { localize "str_pickup_limit_1","PLAIN DOWN" };
_playerID = getPlayerUID player;
@@ -29,8 +28,6 @@ if (isnil "claimed") then {
canPickup = false;
if (_classname isKindOf "TrapBear") exitWith { deleteVehicle _holder; };
player playActionNow "PutDown";
//Adding random chance of arrow is re-usable on pickup
@@ -74,6 +71,17 @@ _isOk = [player,_config] call BIS_fnc_invAdd;
true call dz_fn_meleeMagazines;
if (_isOk) then {
if (_holder isKindOf "TrapItems") then {
if !(_holder getVariable ["fullRefund",true]) then {
//Trap was already triggered, refund all parts except grenade
player removeMagazine _classname;
["equip_string",1,1] call fn_dropItem;
["PartWoodPile",1,1] call fn_dropItem;
["equip_duct_tape",1,1] call fn_dropItem;
};
PVDZ_obj_Destroy = [(_holder getVariable["ObjectID","0"]),(_holder getVariable["ObjectUID","0"]),player];
publicVariableServer "PVDZ_obj_Destroy";
};
deleteVehicle _holder;
} else {
if (!_isOk) exitWith {

View File

@@ -1,40 +0,0 @@
private ["_item","_config","_onLadder","_classname","_text","_consume","_hastrapitem","_location","_object"];
_item = _this;
_config = configFile >> "CfgWeapons" >> _item;
if (dayz_actionInProgress) exitWith { localize "str_player_actionslimit" call dayz_rollingMessages; };
dayz_actionInProgress = true;
_onLadder = (getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder")) == 1;
if (_onLadder) exitWith { dayz_actionInProgress = false; localize "str_player_21" call dayz_rollingMessages;};
call gear_ui_init;
_classname = getText (configFile >> "CfgMagazines" >> _item >> "ItemActions" >> "Build" >> "create");
_text = getText (configFile >> "CfgVehicles" >> _classname >> "displayName");
_consume = ([] + getArray (_config >> "magazines")) select 0;
_hastrapitem = _item in magazines player;
if (!_hastrapitem) exitWith { dayz_actionInProgress = false; format[localize "str_player_31",_text,localize "str_player_31_place"] call dayz_rollingMessages;};
player removeMagazine _item;
_location = getPosATL player;
player playActionNow "PutDown";
sleep 1;
_object = createVehicle [_classname, _location, [], 0, "CAN_COLLIDE"];
_object setDir (getDir player);
_object setVariable ["armed", false, true];
PVDZ_obj_Publish = [dayz_characterID,_object,[getDir _object, getPosATL _object],[["armed", _object getVariable "armed"]]];
publicVariableServer "PVDZ_obj_Publish";
diag_log [diag_ticktime, __FILE__, "New Networked object, request to save to hive. PVDZ_obj_Publish:", PVDZ_obj_Publish];
player reveal _object;
dayz_actionInProgress = false;
format[localize "str_build_01",_text] call dayz_rollingMessages;