2016-07-30 12:00:42 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
ADDON = false;
|
|
|
|
|
2016-12-10 03:03:52 +00:00
|
|
|
PREP_RECOMPILE_START;
|
2016-07-30 12:00:42 +00:00
|
|
|
#include "XEH_PREP.hpp"
|
2016-12-10 03:03:52 +00:00
|
|
|
PREP_RECOMPILE_END;
|
2016-07-30 12:00:42 +00:00
|
|
|
|
2016-08-27 06:50:55 +00:00
|
|
|
// Hack for #3168 (units in static weapons do not take any damage):
|
|
|
|
// Doing a manual pre-load with a small distance seems to fix the LOD problems
|
|
|
|
// with handle damage not returning full results.
|
|
|
|
GVAR(fixedStatics) = [];
|
|
|
|
|
|
|
|
private _fnc_fixStatic = {
|
|
|
|
params ["_vehicle"];
|
|
|
|
private _type = typeOf _vehicle;
|
|
|
|
|
|
|
|
if !(_type in GVAR(fixedStatics)) then {
|
|
|
|
GVAR(fixedStatics) pushBack _type;
|
|
|
|
PRELOAD_CLASS(_type);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
["StaticWeapon", "init", _fnc_fixStatic] call CBA_fnc_addClassEventHandler;
|
|
|
|
["Car", "init", _fnc_fixStatic] call CBA_fnc_addClassEventHandler;
|
|
|
|
|
|
|
|
addMissionEventHandler ["Loaded", {
|
|
|
|
{
|
|
|
|
PRELOAD_CLASS(_x);
|
|
|
|
} forEach GVAR(fixedStatics);
|
|
|
|
}];
|
|
|
|
|
2016-07-30 12:00:42 +00:00
|
|
|
ADDON = true;
|