From 270f9f3662478ce55ab33b03fabae57a3a18a905 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 28 Apr 2015 13:26:52 -0500 Subject: [PATCH] Fix init order problem --- addons/vehiclelock/config.cpp | 2 +- .../vehiclelock/functions/fnc_handleVehicleInitPost.sqf | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/vehiclelock/config.cpp b/addons/vehiclelock/config.cpp index 608a892b45..76d5817d8d 100644 --- a/addons/vehiclelock/config.cpp +++ b/addons/vehiclelock/config.cpp @@ -7,7 +7,7 @@ class CfgPatches { requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_interaction"}; author[] = {"PabstMirror"}; - authorUrl = "https://github.com/PabstMirror/"; + authorUrl = "https://github.com/acemod/ACE3"; VERSION_CONFIG; }; }; diff --git a/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf b/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf index df875b1859..5a2bc3f7bd 100644 --- a/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf +++ b/addons/vehiclelock/functions/fnc_handleVehicleInitPost.sqf @@ -1,6 +1,7 @@ /* * Author: PabstMirror - * Function for sync module. Assigns keys for all synced vehicles to any players that are synced. + * For every lockable vehicle, sets the starting lock state to a sane value. + * Only run if the InitModule is placed. * * Arguments: * 0: Vehicle @@ -18,9 +19,10 @@ PARAMS_1(_vehicle); if (!isServer) exitWith {}; -if (GVAR(VehicleStartingLockState) == -1) exitWith {}; [{ + //If the module wasn't placed, just exit (needs to be in wait because objectInitEH is before moduleInit) + if (GVAR(VehicleStartingLockState) == -1) exitWith {}; private ["_lock"]; PARAMS_1(_vehicle); if ((_vehicle isKindOf "Car") || {_vehicle isKindOf "Tank"} || {_vehicle isKindOf "Helicopter"}) then { @@ -36,4 +38,4 @@ if (GVAR(VehicleStartingLockState) == -1) exitWith {}; }; }; //Delay call until mission start (so everyone has the eventHandler's installed) -}, [_vehicle], 0.25, 0.25] call EFUNC(common,waitAndExecute); \ No newline at end of file +}, [_vehicle], 0.25, 0.25] call EFUNC(common,waitAndExecute);