Skip to content

Commit

Permalink
vehLock - debug trace / type checking
Browse files Browse the repository at this point in the history
  • Loading branch information
PabstMirror committed Aug 7, 2015
1 parent 50adc7c commit a9ed105
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 2 deletions.
5 changes: 4 additions & 1 deletion addons/vehiclelock/functions/fnc_addKeyForVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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");};
Expand Down
1 change: 1 addition & 0 deletions addons/vehiclelock/functions/fnc_getVehicleSideKey.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
private ["_vehConfigSide","_vehSide","_returnValue"];

params ["_veh"];
TRACE_1("params",_veh);

if (isNull _veh) exitWith {ERROR("null vehicle"); "error"};

Expand Down
3 changes: 2 additions & 1 deletion addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
1 change: 1 addition & 0 deletions addons/vehiclelock/functions/fnc_hasKeyForVehicle.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 1 addition & 0 deletions addons/vehiclelock/functions/fnc_lockpick.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
1 change: 1 addition & 0 deletions addons/vehiclelock/functions/fnc_moduleInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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");};

Expand Down
1 change: 1 addition & 0 deletions addons/vehiclelock/functions/fnc_moduleSync.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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");};

Expand Down
1 change: 1 addition & 0 deletions addons/vehiclelock/functions/fnc_onOpenInventory.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");};
Expand Down
1 change: 1 addition & 0 deletions addons/vehiclelock/functions/fnc_setVehicleLockEH.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a9ed105

Please sign in to comment.