diff --git a/Missionframework/functions/fn_protectObject.sqf b/Missionframework/functions/fn_protectObject.sqf index 2e86d61a..61e49ca5 100644 --- a/Missionframework/functions/fn_protectObject.sqf +++ b/Missionframework/functions/fn_protectObject.sqf @@ -2,20 +2,26 @@ File: fn_protectObject.sqf Author: KP Liberation Dev Team - https://github.com/KillahPotatoes Date: 2019-12-03 - Last Update: 2019-12-03 + Last Update: 2019-12-08 License: MIT License - http://www.opensource.org/licenses/MIT Description: - No description added yet. + Given object will get damage and simulation enabled/disabled. Parameter(s): - _localVariable - Description [DATATYPE, defaults to DEFAULTVALUE] + _obj - Object to (un)protect [OBJECT, defaults to objNull] + _enable - Enable/Disable [BOOL, defaults to true] Returns: Function reached the end [BOOL] */ -// TODO -params [ "_obj", "_enable" ]; + +params [ + ["_obj", objNull, [objNull]], + ["_enable", true, [false]] +]; + +if (isNull _obj) exitWith {["Null object given"] call BIS_fnc_error; false}; _obj allowDamage _enable; _obj enableSimulation _enable; diff --git a/Missionframework/scripts/client/ammoboxes/do_unload_truck.sqf b/Missionframework/scripts/client/ammoboxes/do_unload_truck.sqf index 3f53b1b3..9b78c718 100644 --- a/Missionframework/scripts/client/ammoboxes/do_unload_truck.sqf +++ b/Missionframework/scripts/client/ammoboxes/do_unload_truck.sqf @@ -22,13 +22,13 @@ if ( _truck_to_unload getVariable ["GRLIB_ammo_truck_load", 0] > 0 ) then { _next_box setDamage 0; _offset = _offset - 2.2; sleep 0.5; - [_next_box, true] remoteExec ["KPLIB_fnc_protectObject"]; + [_next_box] remoteExec ["KPLIB_fnc_protectObject"]; [_next_box, true] remoteExec ["enableRopeAttach"]; } foreach ( attachedObjects _truck_to_unload); sleep 0.5; - [_truck_to_unload, true] remoteExec ["KPLIB_fnc_protectObject"]; + [_truck_to_unload] remoteExec ["KPLIB_fnc_protectObject"]; hint localize "STR_BOX_UNLOADED"; uiSleep 2;