mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
fixed vehicle crashes for adv
This commit is contained in:
parent
bc4d102d08
commit
d1a09ae7fc
@ -57,6 +57,12 @@ if (GVAR(level) >= 2) then {
|
||||
_minLethalDamage = GVAR(minLethalDamages) select _typeIndex;
|
||||
};
|
||||
|
||||
if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _source} && {_projectile == ""} && {_selection == ""}) then {
|
||||
if (GVAR(enableVehicleCrashes)) then {
|
||||
_selection = GVAR(SELECTIONS) select (floor(random(count GVAR(SELECTIONS))));
|
||||
};
|
||||
};
|
||||
|
||||
if ((_minLethalDamage <= _newDamage) && {[_unit, [_selection] call FUNC(selectionNameToNumber), _newDamage] call FUNC(determineIfFatal)} && {_selection in ["", "head", "body"]}) then {
|
||||
if ([_unit] call FUNC(setDead)) then {
|
||||
_damageReturn = 1;
|
||||
|
@ -33,10 +33,12 @@ if (isNull _sourceOfDamage && {_typeOfProjectile == ""} && {vehicle _unit == _un
|
||||
};
|
||||
_typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage);
|
||||
_part = [_selectionName] call FUNC(selectionNameToNumber);
|
||||
if (_part < 0) exitwith {};
|
||||
|
||||
_hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"];
|
||||
// Sorting out the damage
|
||||
_damageBodyParts = _unit getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]];
|
||||
|
||||
_damageBodyParts set [_part, (_damageBodyParts select _part) + _newDamage];
|
||||
_unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true];
|
||||
|
||||
|
@ -38,7 +38,7 @@ if (_selectionName in _hitSelections) then {
|
||||
|
||||
// Check for vehicle crash
|
||||
if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isNull _source} && {_projectile == ""} && {_selectionName == ""}) then {
|
||||
if (missionNamespace getvariable [QGVAR(allowVehicleCrashDamage), true]) then {
|
||||
if (GVAR(enableVehicleCrashes)) then {
|
||||
_selectionName = _hitSelections select (floor(random(count _hitSelections)));
|
||||
_projectile = "vehiclecrash";
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user