Merge pull request #1759 from jonpas/addEarplugsEnhancement

Exit addEarplugs if earplugs are used
This commit is contained in:
Nicolás Badano 2015-07-01 12:48:14 -03:00
commit e01ff79e41

View File

@ -15,11 +15,12 @@
*/
#include "script_component.hpp"
if (!GVAR(enableCombatDeafness)) exitWith {};
PARAMS_1(_unit);
private ["_unit", "_launcher"];
// Exit if hearing is disabled or soldier has earplugs already in (persistence scenarios)
if (!GVAR(enableCombatDeafness) || {[_unit] call FUNC(hasEarPlugsIn)}) exitWith {};
_unit = _this select 0;
private ["_launcher"];
// add earplugs if the soldier has a rocket launcher
_launcher = secondaryWeapon _unit;