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

@@ -11,6 +11,24 @@ _init = {
};
_arm = {
_exit = false;
if (!isDedicated && !(_trap getVariable["fullRefund",true])) then {
_exit = true;
{
if (_x in magazines player) exitWith {
player removeMagazine _x;
_exit = false;
_trap setVariable ["fullRefund",true,true];
};
} count ["SmokeShell","SmokeShellRed","SmokeShellGreen"];
};
if (_exit) exitWith {
//Trap was already triggered, require smoke to rearm
format[localize "str_player_03",localize "str_dn_smoke"] call dayz_rollingMessages;
};
//if (isServer) then {
_pos = getPosATL _trap;
_pos1 = _trap modelToWorld (_trap selectionPosition "TripA");
@@ -28,7 +46,7 @@ _arm = {
[_trap, _trigger] call arm_trap;
//} else {
_trap setVariable ["armed", true, true];
//_trap setVariable ["armed", true, true];
//};
};
@@ -45,12 +63,14 @@ _remove = {
[_trap] call remove_trap;
} else {
[_trap] call remove_trap;
//Refund is determined in object_pickup.sqf
[0,0,0,["cfgMagazines","ItemTrapTripwireSmoke",_trap]] spawn object_pickup;
};
};
_trigger = {
//if (isServer) then {
if (isServer) then {
private "_entity";
_entity = _this select 0;
@@ -62,7 +82,10 @@ _trigger = {
_flare = createVehicle ["SmokeShell", _position, [], 0, "CAN_COLLIDE"];
[_trap] call trigger_trap;
//};
//TO-DO: save this variable to DB, currently allows one free rearm after server restart
_trap setVariable ["fullRefund",false,true];
};
};
private ["_event", "_trap", "_args"];