mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-20 18:36:29 +03:00
Fix potential undefined error on bear trap trigger
https://github.com/EpochModTeam/DayZ-Epoch/issues/1891#issuecomment-282476563
This commit is contained in:
@@ -50,18 +50,20 @@ _remove = {
|
||||
|
||||
_trigger = {
|
||||
if (isServer) then {
|
||||
private ["_entity"];
|
||||
private "_entity";
|
||||
_entity = _this select 0;
|
||||
|
||||
_trap animate ["LeftShutter", 1];
|
||||
_trap animate ["RightShutter", 1];
|
||||
|
||||
[nil,_trap,rSAY,["trap_bear_0",60]] call RE;
|
||||
|
||||
if (_entity isKindOf "Animal") then {
|
||||
_entity setDamage 1;
|
||||
} else {
|
||||
[_entity, "Legs", [_entity]] call server_sendToClient;
|
||||
|
||||
if (!isNull _entity) then {
|
||||
if (_entity isKindOf "Animal") then {
|
||||
_entity setDamage 1;
|
||||
} else {
|
||||
[_entity, "Legs", [_entity]] call server_sendToClient;
|
||||
};
|
||||
};
|
||||
|
||||
[_trap] call trigger_trap;
|
||||
@@ -71,7 +73,7 @@ _trigger = {
|
||||
private ["_event", "_trap", "_args"];
|
||||
_event = _this select 0;
|
||||
_trap = if (typeOf (_this select 1) == "EmptyDetector") then { dayz_traps_active select (dayz_traps_trigger find (_this select 1)) } else { _this select 1 };
|
||||
_args = if (count _this > 2) then { _this select 2 } else { [] };
|
||||
_args = if (count _this > 2) then { _this select 2 } else { [objNull] };
|
||||
|
||||
switch (_event) do {
|
||||
case "init": {
|
||||
|
||||
@@ -51,7 +51,7 @@ _remove = {
|
||||
|
||||
_trigger = {
|
||||
if (isServer) then {
|
||||
private ["_entity"];
|
||||
private "_entity";
|
||||
_entity = _this select 0;
|
||||
|
||||
// don't work (due to proxies n stuff)
|
||||
@@ -59,11 +59,13 @@ _trigger = {
|
||||
//_trap animate ["RightShutter", 1];
|
||||
|
||||
[nil,_trap,rSAY,["trap_bear_0",60]] call RE;
|
||||
|
||||
if (_entity isKindOf "Animal") then {
|
||||
_entity setDamage 1;
|
||||
} else {
|
||||
[_entity, "Legs", [_entity]] call server_sendToClient;
|
||||
|
||||
if (!isNull _entity) then {
|
||||
if (_entity isKindOf "Animal") then {
|
||||
_entity setDamage 1;
|
||||
} else {
|
||||
[_entity, "Legs", [_entity]] call server_sendToClient;
|
||||
};
|
||||
};
|
||||
|
||||
_flare = createVehicle ["RoadFlare", getPosATL _trap, [], 0, "CAN_COLLIDE"];
|
||||
@@ -90,7 +92,7 @@ _trigger = {
|
||||
private ["_event", "_trap", "_args"];
|
||||
_event = _this select 0;
|
||||
_trap = if (typeOf (_this select 1) == "EmptyDetector") then { dayz_traps_active select (dayz_traps_trigger find (_this select 1)) } else { _this select 1 };
|
||||
_args = if (count _this > 2) then { _this select 2 } else { [] };
|
||||
_args = if (count _this > 2) then { _this select 2 } else { [objNull] };
|
||||
|
||||
switch (_event) do {
|
||||
case "init": {
|
||||
|
||||
@@ -51,7 +51,7 @@ _remove = {
|
||||
|
||||
_trigger = {
|
||||
if (isServer) then {
|
||||
private ["_entity"];
|
||||
private "_entity";
|
||||
_entity = _this select 0;
|
||||
|
||||
// don't work (due to proxies n stuff)
|
||||
@@ -60,10 +60,12 @@ _trigger = {
|
||||
|
||||
[nil,_trap,rSAY,["trap_bear_0",60]] call RE;
|
||||
|
||||
if (_entity isKindOf "Animal") then {
|
||||
_entity setDamage 1;
|
||||
} else {
|
||||
[_entity, "Legs", [_entity]] call server_sendToClient;
|
||||
if (!isNull _entity) then {
|
||||
if (_entity isKindOf "Animal") then {
|
||||
_entity setDamage 1;
|
||||
} else {
|
||||
[_entity, "Legs", [_entity]] call server_sendToClient;
|
||||
};
|
||||
};
|
||||
|
||||
createVehicle ["SmokeShell", getPosATL _trap, [], 0, "CAN_COLLIDE"];
|
||||
@@ -86,7 +88,7 @@ _trigger = {
|
||||
private ["_event", "_trap", "_args"];
|
||||
_event = _this select 0;
|
||||
_trap = if (typeOf (_this select 1) == "EmptyDetector") then { dayz_traps_active select (dayz_traps_trigger find (_this select 1)) } else { _this select 1 };
|
||||
_args = if (count _this > 2) then { _this select 2 } else { [] };
|
||||
_args = if (count _this > 2) then { _this select 2 } else { [objNull] };
|
||||
|
||||
switch (_event) do {
|
||||
case "init": {
|
||||
|
||||
@@ -51,7 +51,7 @@ _remove = {
|
||||
|
||||
_trigger = {
|
||||
if (isServer) then {
|
||||
private ["_entity"];
|
||||
private "_entity";
|
||||
_entity = _this select 0;
|
||||
|
||||
[nil,_trap,rSAY,["z_trap_trigger_0",60]] call RE;
|
||||
@@ -64,7 +64,7 @@ _trigger = {
|
||||
private ["_event", "_trap", "_args"];
|
||||
_event = _this select 0;
|
||||
_trap = if (typeOf (_this select 1) == "EmptyDetector") then { dayz_traps_active select (dayz_traps_trigger find (_this select 1)) } else { _this select 1 };
|
||||
_args = if (count _this > 2) then { _this select 2 } else { [] };
|
||||
_args = if (count _this > 2) then { _this select 2 } else { [objNull] };
|
||||
|
||||
switch (_event) do {
|
||||
case "init": {
|
||||
|
||||
@@ -51,7 +51,7 @@ _remove = {
|
||||
|
||||
_trigger = {
|
||||
if (isServer) then {
|
||||
private ["_entity"];
|
||||
private "_entity";
|
||||
_entity = _this select 0;
|
||||
|
||||
[nil,_trap,rSAY,["z_trap_trigger_0",60]] call RE;
|
||||
@@ -72,7 +72,7 @@ _trigger = {
|
||||
private ["_event", "_trap", "_args"];
|
||||
_event = _this select 0;
|
||||
_trap = if (typeOf (_this select 1) == "EmptyDetector") then { dayz_traps_active select (dayz_traps_trigger find (_this select 1)) } else { _this select 1 };
|
||||
_args = if (count _this > 2) then { _this select 2 } else { [] };
|
||||
_args = if (count _this > 2) then { _this select 2 } else { [objNull] };
|
||||
|
||||
switch (_event) do {
|
||||
case "init": {
|
||||
|
||||
@@ -51,7 +51,7 @@ _remove = {
|
||||
|
||||
_trigger = {
|
||||
if (isServer) then {
|
||||
private ["_entity"];
|
||||
private "_entity";
|
||||
_entity = _this select 0;
|
||||
|
||||
[nil,_trap,rSAY,["z_trap_trigger_0",60]] call RE;
|
||||
@@ -68,7 +68,7 @@ _trigger = {
|
||||
private ["_event", "_trap", "_args"];
|
||||
_event = _this select 0;
|
||||
_trap = if (typeOf (_this select 1) == "EmptyDetector") then { dayz_traps_active select (dayz_traps_trigger find (_this select 1)) } else { _this select 1 };
|
||||
_args = if (count _this > 2) then { _this select 2 } else { [] };
|
||||
_args = if (count _this > 2) then { _this select 2 } else { [objNull] };
|
||||
|
||||
switch (_event) do {
|
||||
case "init": {
|
||||
|
||||
@@ -51,7 +51,7 @@ _remove = {
|
||||
|
||||
_trigger = {
|
||||
//if (isServer) then {
|
||||
private ["_entity"];
|
||||
private "_entity";
|
||||
_entity = _this select 0;
|
||||
|
||||
[nil,_trap,rSAY,["z_trap_trigger_0",60]] call RE;
|
||||
@@ -68,7 +68,7 @@ _trigger = {
|
||||
private ["_event", "_trap", "_args"];
|
||||
_event = _this select 0;
|
||||
_trap = if (typeOf (_this select 1) == "EmptyDetector") then { dayz_traps_active select (dayz_traps_trigger find (_this select 1)) } else { _this select 1 };
|
||||
_args = if (count _this > 2) then { _this select 2 } else { [] };
|
||||
_args = if (count _this > 2) then { _this select 2 } else { [objNull] };
|
||||
|
||||
switch (_event) do {
|
||||
case "init": {
|
||||
|
||||
Reference in New Issue
Block a user