mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-23 04:22:13 +03:00
Fix some issues with traps
Removed two unused files. Vanilla commits:42e72463a302726fb1926a7c53ebcf1fb63089959543ea057f
This commit is contained in:
@@ -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"];
|
||||
|
||||
Reference in New Issue
Block a user