Fix vehicle crashes not being fatal to non-drivers

Fix #3306
This commit is contained in:
PabstMirror 2016-02-15 17:11:04 -06:00
parent d88f10b8e0
commit 9441b548be
2 changed files with 8 additions and 4 deletions

View File

@ -77,9 +77,11 @@ _minLethalDamage = if (_typeIndex >= 0) then {
0.01
};
if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _shooter} && {_projectile == ""} && {_selection == ""}) then {
private _vehicle = vehicle _unit;
if ((_vehicle != _unit) && {!(_vehicle isKindOf "StaticWeapon")} && {_shooter in [objNull, driver _vehicle, _vehicle]} && {_projectile == ""} && {_selection == ""}) then {
if (GVAR(enableVehicleCrashes)) then {
_selection = GVAR(SELECTIONS) select (floor(random(count GVAR(SELECTIONS))));
_selection = _this select 1; //pull random selection from HDC
TRACE_1("Veh Crash",_selection);
};
};

View File

@ -29,9 +29,11 @@ if (_hitPointIndex >= 0) then {_newDamage = _damage - (_unit getHitIndex _hitPoi
TRACE_7("ACE_DEBUG: HandleDamage_Caching Called",_unit, _selectionName, _damage, _source, _projectile,_hitPointIndex,_newDamage);
// Check for vehicle crash
if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _source} && {_projectile == ""} && {_selectionName == ""}) then {
private _vehicle = vehicle _unit;
if ((_vehicle != _unit) && {!(_vehicle isKindOf "StaticWeapon")} && {_source in [objNull, driver _vehicle, _vehicle]} && {_projectile == ""} && {_selectionName == ""}) then {
if (GVAR(enableVehicleCrashes)) then {
_selectionName = _hitSelections select (floor(random(count _hitSelections)));
TRACE_1("Veh Crash",_selectionName);
_projectile = "vehiclecrash";
_this set [1, _selectionName];
_this set [4, _projectile];
@ -40,7 +42,7 @@ if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isN
// Handle falling damage
_impactVelocity = (velocity _unit) select 2;
if (_impactVelocity < -5 && {vehicle _unit == _unit}) then {
if (_impactVelocity < -5 && {_vehicle == _unit}) then {
TRACE_1("Starting isFalling", time);
_unit setVariable [QGVAR(isFalling), true];
_unit setVariable [QGVAR(impactVelocity), _impactVelocity];