From a9ed1052ddb1ebc00c1fa5465e35a0ad9f8483f6 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 7 Aug 2015 13:24:47 -0500 Subject: [PATCH] vehLock - debug trace / type checking --- addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf | 5 ++++- addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf | 1 + addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf | 3 ++- addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf | 1 + addons/vehiclelock/functions/fnc_lockpick.sqf | 1 + addons/vehiclelock/functions/fnc_moduleInit.sqf | 1 + addons/vehiclelock/functions/fnc_moduleSync.sqf | 1 + addons/vehiclelock/functions/fnc_onOpenInventory.sqf | 1 + addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf | 1 + addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf | 1 + 10 files changed, 14 insertions(+), 2 deletions(-) diff --git a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf index 1adec69413..073054648e 100644 --- a/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf +++ b/addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf @@ -20,7 +20,10 @@ private ["_previousMags","_newMags","_keyMagazine","_keyName"]; -params ["_unit", "_veh", "_useCustom"]; +if (!params [["_unit", objNull, [objNull]], ["_veh", objNull, [objNull]], ["_useCustom", false, [false]]]) exitWith { + ERROR("Input wrong type"); +}; +TRACE_3("params",_unit,_veh,_useCustom); if (isNull _unit) exitWith {ERROR("null unit");}; if (isNull _veh) exitWith {ERROR("null vehicle");}; diff --git a/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf b/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf index e981a16842..eda75922c4 100644 --- a/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf +++ b/addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf @@ -18,6 +18,7 @@ private ["_vehConfigSide","_vehSide","_returnValue"]; params ["_veh"]; +TRACE_1("params",_veh); if (isNull _veh) exitWith {ERROR("null vehicle"); "error"}; diff --git a/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf b/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf index f252c25c93..be23dc8dd9 100644 --- a/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf +++ b/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf @@ -19,6 +19,7 @@ if (!isServer) exitWith {}; params ["_vehicle"]; +TRACE_1("params",_vehicle); [{ //If the module wasn't placed, just exit (needs to be in wait because objectInitEH is before moduleInit) @@ -41,4 +42,4 @@ params ["_vehicle"]; }; }; //Delay call until mission start (so everyone has the eventHandler's installed) -}, [_vehicle], 0.25, 0.25] call EFUNC(common,waitAndExecute); +}, [_vehicle], 0.25] call EFUNC(common,waitAndExecute); diff --git a/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf b/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf index 6b91c1cc0d..390104cefc 100644 --- a/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf +++ b/addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf @@ -19,6 +19,7 @@ private ["_returnValue","_sideKeyName","_customKeys"]; params ["_unit", "_veh"]; +TRACE_2("params",_unit,_veh); if (isNull _unit) exitWith {ERROR("null unit"); false}; if (isNull _veh) exitWith {ERROR("null vehicle"); false}; diff --git a/addons/vehiclelock/functions/fnc_lockpick.sqf b/addons/vehiclelock/functions/fnc_lockpick.sqf index 75a7f59240..f4837c742b 100644 --- a/addons/vehiclelock/functions/fnc_lockpick.sqf +++ b/addons/vehiclelock/functions/fnc_lockpick.sqf @@ -23,6 +23,7 @@ private ["_vehLockpickStrenth","_condition","_returnValue"]; params ["_unit", "_veh", "_funcType"]; +TRACE_3("params",_unit,_veh,_funcType); if (isNull _unit) exitWith {ERROR("null unit"); false}; if (isNull _veh) exitWith {ERROR("null vehicle"); false}; diff --git a/addons/vehiclelock/functions/fnc_moduleInit.sqf b/addons/vehiclelock/functions/fnc_moduleInit.sqf index 2b0889b814..9b2c3cf182 100644 --- a/addons/vehiclelock/functions/fnc_moduleInit.sqf +++ b/addons/vehiclelock/functions/fnc_moduleInit.sqf @@ -20,6 +20,7 @@ if (!isServer) exitWith {}; params ["_logic", "_syncedUnits", "_activated"]; +TRACE_3("params",_logic,_syncedObjects,_activated); if (!_activated) exitWith {WARNING("Vehicle Lock Init Module - placed but not active");}; diff --git a/addons/vehiclelock/functions/fnc_moduleSync.sqf b/addons/vehiclelock/functions/fnc_moduleSync.sqf index a43e462113..27577e4dbe 100644 --- a/addons/vehiclelock/functions/fnc_moduleSync.sqf +++ b/addons/vehiclelock/functions/fnc_moduleSync.sqf @@ -20,6 +20,7 @@ if (!isServer) exitWith {}; params ["_logic", "_syncedObjects", "_activated"]; +TRACE_3("params",_logic,_syncedObjects,_activated); if !(_activated) exitWith {WARNING("Vehicle Lock Sync Module - placed but not active");}; diff --git a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf index 0105f5ae3f..5db2cbebe0 100644 --- a/addons/vehiclelock/functions/fnc_onOpenInventory.sqf +++ b/addons/vehiclelock/functions/fnc_onOpenInventory.sqf @@ -17,6 +17,7 @@ #include "script_component.hpp" params ["_unit", "_container"]; +TRACE_2("params",_unit,_container); //Only check for player: if (_unit != ace_player) exitWith {false}; diff --git a/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf b/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf index 6f1c2ffdbe..e959a705e0 100644 --- a/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf +++ b/addons/vehiclelock/functions/fnc_serverSetupCustomKeyEH.sqf @@ -19,6 +19,7 @@ private ["_currentKeys"]; params ["_veh", "_key"]; +TRACE_2("params",_veh,_key); if (!isServer) exitWith {ERROR("only run on server");}; if (isNull _veh) exitWith {ERROR("null vehicle");}; diff --git a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf index 611ce76e30..d2290ef732 100644 --- a/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf +++ b/addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf @@ -19,6 +19,7 @@ private ["_lockNumber"]; params ["_veh", "_isLocked"]; +TRACE_2("params",_veh,_isLocked); _lockNumber = if (_isLocked) then {2} else {0}; TRACE_2("Setting Lock State", _veh, _lockNumber);