ACE3/addons/repair/XEH_preInit.sqf

43 lines
1.3 KiB
Plaintext
Raw Normal View History

2015-03-10 17:05:56 +00:00
#include "script_component.hpp"
ADDON = false;
PREP_RECOMPILE_START;
2016-02-22 14:20:36 +00:00
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
2015-03-10 17:05:56 +00:00
["ACE_RepairItem_Base", "killed", {
params ["_object"];
[{deleteVehicle _this}, _object, 5] call CBA_fnc_waitAndExecute;
}] call CBA_fnc_addClassEventHandler;
// load tracks and wheels
if (isServer) then {
private _fnc_addSpareItems = {
if (!GVAR(addSpareParts)) exitWith {};
params ["_vehicle"];
private _spareTracks = _vehicle getVariable QGVAR(editorLoadedTracks);
if (isNil "_spareTracks") then {
_spareTracks = [0, 1] select (_vehicle isKindOf "Tank"); // must match eden attribute default
};
if (_spareTracks > 0) then {
[_vehicle, _spareTracks, "ACE_Track"] call FUNC(addSpareParts);
};
private _spareWheels = _vehicle getVariable QGVAR(editorLoadedWheels);
if (isNil "_spareWheels") then {
_spareWheels = [0, 1] select (_vehicle isKindOf "Car"); // must match eden attribute default
};
if (_spareWheels > 0) then {
[_vehicle, _spareWheels, "ACE_Wheel"] call FUNC(addSpareParts);
};
};
["Tank", "initPost", _fnc_addSpareItems] call CBA_fnc_addClassEventHandler;
["Car", "initPost", _fnc_addSpareItems] call CBA_fnc_addClassEventHandler;
};
2015-03-10 17:05:56 +00:00
ADDON = true;