From 96b92ac1721b19aea4e38f419dced4dff5b75862 Mon Sep 17 00:00:00 2001 From: ulteq Date: Sun, 17 May 2015 11:45:55 +0200 Subject: [PATCH] Added a new module option for advanced ballistics: * alwaysSimulateForGroupMembers --- addons/advanced_ballistics/ACE_Settings.hpp | 6 ++++++ addons/advanced_ballistics/CfgVehicles.hpp | 6 ++++++ addons/advanced_ballistics/functions/fnc_handleFired.sqf | 8 +++++--- .../functions/fnc_initModuleSettings.sqf | 1 + addons/advanced_ballistics/stringtable.xml | 6 ++++++ 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/addons/advanced_ballistics/ACE_Settings.hpp b/addons/advanced_ballistics/ACE_Settings.hpp index 67bc51511e..c931ce4d21 100644 --- a/addons/advanced_ballistics/ACE_Settings.hpp +++ b/addons/advanced_ballistics/ACE_Settings.hpp @@ -11,6 +11,12 @@ class ACE_Settings { typeName = "BOOL"; value = 1; }; + class GVAR(alwaysSimulateForGroupMembers) { + displayName = "Always Enabled For Group Members"; + description = "Always enables advanced ballistics when a group member fires"; + typeName = "BOOL"; + value = 0; + }; class GVAR(disabledInFullAutoMode) { displayName = "Disabled In FullAuto Mode"; description = "Disables the advanced ballistics during full auto fire"; diff --git a/addons/advanced_ballistics/CfgVehicles.hpp b/addons/advanced_ballistics/CfgVehicles.hpp index 4e42f35f72..642faeda96 100644 --- a/addons/advanced_ballistics/CfgVehicles.hpp +++ b/addons/advanced_ballistics/CfgVehicles.hpp @@ -23,6 +23,12 @@ class CfgVehicles { typeName = "BOOL"; defaultValue = 1; }; + class alwaysSimulateForGroupMembers { + displayName = "$STR_ACE_AdvancedBallistics_alwaysSimulateForGroupMembers_DisplayName"; + description = "$STR_ACE_AdvancedBallistics_alwaysSimulateForGroupMembers_Description"; + typeName = "BOOL"; + defaultValue = 0; + }; class disabledInFullAutoMode { displayName = "$STR_ACE_AdvancedBallistics_disabledInFullAutoMod_DisplayName"; description = "$STR_ACE_AdvancedBallistics_disabledInFullAutoMod_Description"; diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index bb0b649da4..33bd02a4e7 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -36,15 +36,17 @@ if (underwater _unit) exitWith {}; if (!(_ammo isKindOf "BulletBase")) exitWith {}; if (_unit distance ACE_player > GVAR(simulationRadius)) exitWith {}; if (GVAR(onlyActiveForLocalPlayers) && !(local _unit)) then { + // The shooter is non local + _abort = true; if (GVAR(alwaysSimulateForSnipers)) then { - // The shooter is non local if (currentWeapon _unit == primaryWeapon _unit && count primaryWeaponItems _unit > 2) then { _opticsName = (primaryWeaponItems _unit) select 2; _opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); _abort = _opticType != 2; // We only abort if the non local shooter is not a sniper }; - } else { - _abort = true; + }; + if (GVAR(alwaysSimulateForGroupMembers) && _abort) then { + _abort = (group ACE_player) != (group _unit); }; }; //if (!GVAR(vehicleGunnerEnabled) && !(_unit isKindOf "Man")) then { _abort = true; }; // We currently do not have firedEHs on vehicles diff --git a/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf b/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf index ba7ea31a8f..554d9470b9 100644 --- a/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf +++ b/addons/advanced_ballistics/functions/fnc_initModuleSettings.sqf @@ -29,6 +29,7 @@ if !(_activated) exitWith {}; [_logic, QGVAR(onlyActiveForLocalPlayers), "onlyActiveForLocalPlayers"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(disabledInFullAutoMode), "disabledInFullAutoMode"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(alwaysSimulateForSnipers), "alwaysSimulateForSnipers"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(alwaysSimulateForGroupMembers), "alwaysSimulateForGroupMembers"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(simulationInterval), "simulationInterval"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(simulationRadius), "simulationRadius"] call EFUNC(common,readSettingFromModule); diff --git a/addons/advanced_ballistics/stringtable.xml b/addons/advanced_ballistics/stringtable.xml index 565e4bd801..79c2ec7c52 100644 --- a/addons/advanced_ballistics/stringtable.xml +++ b/addons/advanced_ballistics/stringtable.xml @@ -45,6 +45,12 @@ Always enables advanced ballistics when high power optics are used Aktywuje zaawansowaną balistykę zawsze, kiedy używana jest optyka + + Always Enabled For Group Members + + + Always enables advanced ballistics when a group member fires + Disabled In FullAuto Mode Wył. podczas ognia auto.