fixed #312 Error occurred with undefined damageTypes. In this case; getting run over by a vehicle.

This commit is contained in:
Glowbal 2015-04-05 15:51:28 +02:00
parent b18d704686
commit c210efcef0

View File

@ -52,7 +52,12 @@ if (GVAR(level) >= 2) then {
if (_damageReturn > 0.9) then {
_typeOfDamage = [_projectile] call FUNC(getTypeOfDamage);
_minLethalDamage = GVAR(minLethalDamages) select (GVAR(allAvailableDamageTypes) find _typeOfDamage);
_typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage);
_minLethalDamage = 0.01;
if (_typeIndex >= 0) then {
_minLethalDamage = GVAR(minLethalDamages) select _typeIndex;
};
_hitPoints = ["HitHead", "HitBody", "HitLeftArm", "HitRightArm", "HitLeftLeg", "HitRightLeg"];
_newDamage = _damage - (damage _unit);