Fix init order problem

This commit is contained in:
PabstMirror 2015-04-28 13:26:52 -05:00
parent f8b8d7dd16
commit 270f9f3662
2 changed files with 6 additions and 4 deletions

View File

@ -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;
};
};

View File

@ -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 <OBJECT>
@ -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);
}, [_vehicle], 0.25, 0.25] call EFUNC(common,waitAndExecute);