mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
80b2fa9a05
* Cook-off improvements * More changes * Update fnc_getVehicleAmmo.sqf * Better engine fire placement * Update fnc_detonateAmmunition.sqf * Update XEH_postInit.sqf * Update fnc_getVehicleAmmo.sqf * Update events-framework.md * Various improvements * Separate effect handling * Tweaks * Update XEH_postInit.sqf * Prevent double ammo detonation * Fixed objects not being able to cook-off again * Added incendiary rounds as source of box cookoff * Converted enable setting to bool * Fixed brackets * Update fnc_cookOff.sqf * Update CfgEden.hpp * Removed GVAR(enable), added GVAR(enableFire) back * Vehicle damage fixes * Made hitpoint hash common * Update fnc_addEventHandler.sqf * Update fnc_medicalDamage.sqf * Update fnc_handleBail.sqf * Changed API * Remove `CBA_fnc_getConfigEntry` as much as possible, as it's 2x slower * More cleanup * More cleanup * Fix merging issues, remove turret tossing * Update translations * More cleanup * Reverted some logic back to original, minor tweaks & fixes * Fix undefined variable * Cleanup * Fixed bad logic * Update addons/vehicle_damage/script_macros.hpp Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/vehicle_damage/functions/fnc_handleDamage.sqf * Update addons/vehicle_damage/stringtable.xml Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/vehicle_damage/stringtable.xml Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> * Update addons/vehicle_damage/XEH_postInit.sqf Co-authored-by: PabstMirror <pabstmirror@gmail.com> --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: PabstMirror <pabstmirror@gmail.com>
46 lines
1.2 KiB
Plaintext
46 lines
1.2 KiB
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: tcvm
|
|
* Sets vehicle damage based on HitIndex. Failing that it falls back to HitPoint name.
|
|
*
|
|
* Arguments:
|
|
* 0: Vehicle <OBJECT>
|
|
* 1: Hit point <STRING>
|
|
* 2: Hit index <NUMBER>
|
|
* 3: Damage <NUMBER>
|
|
* 4: Source of damage <OBJECT>
|
|
* 5: Person who caused damage <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [cursorObject, "HitEngine", 1, 0.25, player, player] call ace_vehicle_damage_fnc_setDamage
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_vehicle", "_hitPoint", "_hitIndex", "_damage", "_source", "_instigator"];
|
|
TRACE_6("setDamage",_vehicle,_hitPoint,_hitIndex,_damage,_source,_instigator);
|
|
|
|
private _currentDamage = _vehicle getHitPointDamage _hitPoint;
|
|
|
|
if (_damage < _currentDamage) exitWith {
|
|
TRACE_3("capping damage at current",_damage,_currentDamage,_hitPoint);
|
|
};
|
|
|
|
if (_hitPoint == "#structural") then {
|
|
_hitPoint = "hithull";
|
|
_hitIndex = -1;
|
|
};
|
|
|
|
if (_hitIndex >= 0) then {
|
|
_vehicle setHitIndex [_hitIndex, _damage, true, _source, _instigator];
|
|
} else {
|
|
_vehicle setHitPointDamage [_hitPoint, _damage, true, _source, _instigator];
|
|
};
|
|
|
|
if (_hitPoint == "HitEngine" && {_damage >= 0.9}) then {
|
|
[QEGVAR(cookoff,engineFireServer), _vehicle] call CBA_fnc_serverEvent;
|
|
};
|