Medical - Add Vehicle Crashes setting (#8149)

Co-authored-by: jonpas <jonpas33@gmail.com>
This commit is contained in:
Salluci 2021-04-20 08:10:50 -03:00 committed by PabstMirror
parent e3a3e29444
commit c7d4981329
3 changed files with 19 additions and 3 deletions

View File

@ -42,3 +42,12 @@
[0, 1, 1, 2, true],
true
] call CBA_fnc_addSetting;
[
QEGVAR(medical,enableVehicleCrashes),
"CHECKBOX",
[LSTRING(EnableVehicleCrashes_DisplayName), LSTRING(EnableVehicleCrashes_Description)],
ELSTRING(medical,Category),
true,
true
] call CBA_fnc_addSetting;

View File

@ -703,5 +703,11 @@
<Key ID="STR_ACE_Medical_Damage_DeathChance_Description">
<English>The chance of dying to a fatal injury.</English>
</Key>
<Key ID="STR_ACE_Medical_Damage_EnableVehicleCrashes_DisplayName">
<English>Enable Vehicle Crash Damage</English>
</Key>
<Key ID="STR_ACE_Medical_Damage_EnableVehicleCrashes_Description">
<English>Controls whether crew receives damage from vehicle collisions.</English>
</Key>
</Package>
</Project>

View File

@ -204,7 +204,8 @@ if (
// It does fire the EH multiple times, but this seems to scale with the intensity of the crash
private _vehicle = vehicle _unit;
if (
_hitPoint isEqualTo "#structural" &&
EGVAR(medical,enableVehicleCrashes) &&
{_hitPoint isEqualTo "#structural"} &&
{_ammo isEqualTo ""} &&
{_vehicle != _unit} &&
{vectorMagnitude (velocity _vehicle) > 5}