From c3986b0a048657ae168dde5f77291160ca592ad8 Mon Sep 17 00:00:00 2001 From: Vdauphin Date: Tue, 22 Aug 2017 19:56:14 +0200 Subject: [PATCH] Add optional parameter useEffects for damage (#5318) Since 1.67, you can skip destruction effects if you want to. see : https://community.bistudio.com/wiki/setDamage and https://community.bistudio.com/wiki/setHitPointDamage This add an optional parameter to ace_repair_fnc_setHitPointDamage to allow this new choice --- addons/repair/functions/fnc_setHitPointDamage.sqf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/addons/repair/functions/fnc_setHitPointDamage.sqf b/addons/repair/functions/fnc_setHitPointDamage.sqf index 9fd036b380..bce27c5954 100644 --- a/addons/repair/functions/fnc_setHitPointDamage.sqf +++ b/addons/repair/functions/fnc_setHitPointDamage.sqf @@ -7,6 +7,7 @@ * 0: Local Vehicle to Damage * 1: Selected hitpoint INDEX * 2: Total Damage + * 3: Skip destruction effects * * Return Value: * None @@ -18,7 +19,7 @@ */ #include "script_component.hpp" -params ["_vehicle", "_hitPointIndex", "_hitPointDamage"]; +params ["_vehicle", "_hitPointIndex", "_hitPointDamage", ["_useEffects", true]]; TRACE_4("params",_vehicle,typeOf _vehicle,_hitPointIndex,_hitPointDamage); private ["_damageNew", "_damageOld", "_hitPointDamageRepaired", "_hitPointDamageSumOld", "_realHitpointCount", "_selectionName"]; @@ -63,14 +64,14 @@ if (_hitPointDamageSumOld > 0) then { TRACE_5("structuralDamage",_damageOld,_damageNew,_hitPointDamageRepaired,_hitPointDamageSumOld,_realHitpointCount); // set new structural damage value -_vehicle setDamage _damageNew; +_vehicle setDamage [_damageNew, _useEffects]; //Repair the hitpoint in the damages array: _allHitPointDamages set [_hitPointIndex, _hitPointDamage]; //Set the new damage for all hitpoints { - _vehicle setHitIndex [_forEachIndex, _x]; + _vehicle setHitIndex [_forEachIndex, _x, _useEffects]; } forEach _allHitPointDamages; // normalize hitpoints