[WIP] Various handleDamage_caching fixes

This commit is contained in:
ulteq 2015-06-10 16:51:46 +02:00
parent 0f6c93852c
commit 9336e7c9e1
3 changed files with 12 additions and 6 deletions

View File

@ -53,7 +53,8 @@ if (GVAR(level) < 2) then {
};
_newDamage = _this call FUNC(handleDamage_caching);
_typeOfDamage = [_projectile] call FUNC(getTypeOfDamage);
systemChat _typeOfDamage;
_typeIndex = (GVAR(allAvailableDamageTypes) find _typeOfDamage);
_minLethalDamage = 0.01;
if (_typeIndex >= 0) then {

View File

@ -47,10 +47,8 @@ _unit setvariable [QGVAR(bodyPartStatus), _damageBodyParts, true];
[_unit] call FUNC(handleDamage_advancedSetDamage);
if (_typeOfProjectile == "" && {_unit getVariable [QGVAR(isFalling), false]}) then {
_typeOfProjectile = "falling";
};
_typeOfDamage = [_typeOfProjectile] call FUNC(getTypeOfDamage);
systemChat _typeOfDamage;
[_unit, _selectionName, _newDamage, _typeOfProjectile, _typeOfDamage] call FUNC(handleDamage_wounds);
// TODO Disabled until implemented fully

View File

@ -41,17 +41,24 @@ if (vehicle _unit != _unit && {!(vehicle _unit isKindOf "StaticWeapon")} && {isN
if (GVAR(enableVehicleCrashes)) then {
_selectionName = _hitSelections select (floor(random(count _hitSelections)));
_projectile = "vehiclecrash";
_this set [4, "vehiclecrash"];
};
};
// From AGM medical:
// Exclude falling damage to everything other than legs; reduce structural damage.
if (((velocity _unit) select 2 < -5) && {(vehicle _unit == _unit)}) then {
_unit setVariable [QGVAR(isFalling), True];
_unit setVariable [QGVAR(isFalling), true];
_projectile = "falling";
_this set [4, "falling"];
};
if (_unit getVariable [QGVAR(isFalling), false] && {!(_selectionName in ["", "leg_l", "leg_r"])}) exitWith {0};
if (_unit getVariable [QGVAR(isFalling), false]) then {
if (_selectionName == "") then {
_selectionName = ["leg_l", "leg_r"] select (floor(random 2));
};
_this set [1, _selectionName];
systemChat Str(_this);
_newDamage = _newDamage * 0.7;
};