mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
reduce some overhead
This commit is contained in:
parent
4bc1c1db56
commit
b0c0156d75
@ -5,7 +5,7 @@
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
* 1: Selection, can be "Head", "Body", "Arms" or "Legs" <STRING>
|
||||
* 2: Damage (optional, default: true) <BOOLEAN>
|
||||
* 2: Damage <BOOLEAN>
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
@ -23,11 +23,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params [["_unit", objNull, [objNull]], ["_selection", "", [""]], ["_damage", true, [false]]];
|
||||
|
||||
if (!local _unit) exitWith {
|
||||
ERROR("Unit not local or null");
|
||||
};
|
||||
params ["_unit", "_selection", "_damage"];
|
||||
|
||||
_damage = [0, DAMAGED_MIN_THRESHOLD] select _damage;
|
||||
|
||||
|
@ -24,16 +24,7 @@ if (!local _unit) exitWith {
|
||||
|
||||
_unit setVariable [QGVAR(isLimping), _isLimping, true];
|
||||
|
||||
if (_isLimping) then {
|
||||
if (_unit getHitPointDamage "HitLegs" >= DAMAGED_MIN_THRESHOLD && {_unit getHitPointDamage "HitLegs" != LIMPING_MIN_DAMAGE}) then {
|
||||
[_unit, "Legs", true] call FUNC(damageBodyPart);
|
||||
} else {
|
||||
[_unit, "Legs", false] call FUNC(damageBodyPart);
|
||||
};
|
||||
} else {
|
||||
if (_unit getHitPointDamage "HitLegs" >= DAMAGED_MIN_THRESHOLD && {_unit getHitPointDamage "HitLegs" != LIMPING_MIN_DAMAGE}) then {
|
||||
[_unit, "Legs", true] call FUNC(damageBodyPart);
|
||||
} else {
|
||||
[_unit, "Legs", false] call FUNC(damageBodyPart);
|
||||
};
|
||||
};
|
||||
// refresh
|
||||
private _isDamaged = _unit getHitPointDamage "HitLegs" >= DAMAGED_MIN_THRESHOLD && {_unit getHitPointDamage "HitLegs" != LIMPING_MIN_DAMAGE};
|
||||
|
||||
[_unit, "Legs", _isDamaged] call FUNC(damageBodyPart);
|
||||
|
@ -16,11 +16,7 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params [["_unit", objNull, [objNull]], ["_bodyPart", "", [""]]];
|
||||
|
||||
if (!local _unit) exitWith {
|
||||
ERROR("Unit not local or null");
|
||||
};
|
||||
params ["_unit", "_bodyPart"];
|
||||
|
||||
if (_bodyPart == "All") exitWith {
|
||||
[_unit, "Head"] call FUNC(updateBodyPartVisuals);
|
||||
|
Loading…
Reference in New Issue
Block a user