2015-03-10 18:55:56 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2016-05-24 16:58:27 +00:00
|
|
|
[QGVAR(setVehicleDamage), {_this call FUNC(setDamage)}] call CBA_fnc_addEventHandler;
|
|
|
|
[QGVAR(setVehicleHitPointDamage), {_this call FUNC(setHitPointDamage)}] call CBA_fnc_addEventHandler;
|
2015-03-29 01:35:55 +00:00
|
|
|
|
|
|
|
// wheels
|
2019-05-03 15:03:17 +00:00
|
|
|
[QGVAR(setWheelHitPointDamage), {
|
|
|
|
params ["_object", "_hitPoint", "_damage"];
|
2019-05-03 15:09:16 +00:00
|
|
|
private _damageDisabled = !isDamageAllowed _object;
|
2019-05-03 15:03:17 +00:00
|
|
|
|
2019-05-03 15:09:16 +00:00
|
|
|
if (_damageDisabled) then {
|
2019-05-03 15:03:17 +00:00
|
|
|
_object allowDamage true;
|
|
|
|
};
|
|
|
|
|
|
|
|
_object setHitPointDamage [_hitPoint, _damage];
|
|
|
|
|
2019-05-03 15:09:16 +00:00
|
|
|
if (_damageDisabled) then {
|
2019-05-03 15:03:17 +00:00
|
|
|
_object allowDamage false;
|
|
|
|
};
|
|
|
|
}] call CBA_fnc_addEventHandler;
|