Added a new module option for advanced ballistics:

* alwaysSimulateForGroupMembers
This commit is contained in:
ulteq 2015-05-17 11:45:55 +02:00
parent 9e8283ebab
commit 96b92ac172
5 changed files with 24 additions and 3 deletions

View File

@ -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";

View File

@ -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";

View File

@ -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

View File

@ -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);

View File

@ -45,6 +45,12 @@
<English>Always enables advanced ballistics when high power optics are used</English>
<Polish>Aktywuje zaawansowaną balistykę zawsze, kiedy używana jest optyka</Polish>
</Key>
<Key ID="STR_ACE_AdvancedBallistics_alwaysSimulateForGroupMembers_DisplayName">
<English>Always Enabled For Group Members</English>
</Key>
<Key ID="STR_ACE_AdvancedBallistics_alwaysSimulateForGroupMembers_Description">
<English>Always enables advanced ballistics when a group member fires</English>
</Key>
<Key ID="STR_ACE_AdvancedBallistics_disabledInFullAutoMod_DisplayName">
<English>Disabled In FullAuto Mode</English>
<Polish>Wył. podczas ognia auto.</Polish>