From b86012a6b18c8bbb5048b8be9d3fd01be1f9c1b3 Mon Sep 17 00:00:00 2001 From: Glowbal Date: Mon, 4 May 2015 00:16:12 +0200 Subject: [PATCH] Ensure that litterCondition is always code #1000 --- addons/medical/functions/fnc_createLitter.sqf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/medical/functions/fnc_createLitter.sqf b/addons/medical/functions/fnc_createLitter.sqf index 253a3ed315..8682cc24d5 100644 --- a/addons/medical/functions/fnc_createLitter.sqf +++ b/addons/medical/functions/fnc_createLitter.sqf @@ -46,11 +46,11 @@ _createLitter = { _position = [(_position select 0) - random 2, (_position select 1) - random 2, _position select 2]; }; _direction = (random 360); - + // Create the litter, and timeout the event based on the cleanup delay - // The cleanup delay for events in MP is handled by the server side + // The cleanup delay for events in MP is handled by the server side [QGVAR(createLitter), [_litterClass,_position,_direction], 0] call EFUNC(common,syncedEvent); - + true }; @@ -68,6 +68,7 @@ _createdLitter = []; _litterCondition = if (_litterCondition != "") then {compile _litterCondition} else {{true}}; } else { _litterCondition = missionNamespace getvariable _litterCondition; + if (typeName _litterCondition != "CODE") then {_litterCondition = {false}}; }; if !([_caller, _target, _selectionName, _className, _usersOfItems] call _litterCondition) exitwith {};