2016-09-30 09:23:07 +00:00
|
|
|
/*
|
|
|
|
* Author: commy2
|
|
|
|
* Forces a unit to limp or not.
|
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Unit <OBJECT>
|
|
|
|
* 1: Limping (optional, default: true) <BOOLEAN>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player, true] call ace_medical_engine_fnc_setLimping
|
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
#include "script_component.hpp"
|
|
|
|
|
|
|
|
params [["_unit", objNull, [objNull]], ["_isLimping", true, [false]]];
|
|
|
|
|
|
|
|
if (!local _unit) exitWith {
|
2016-10-02 15:50:17 +00:00
|
|
|
ERROR("Unit not local or null");
|
2016-09-30 09:23:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
_unit setVariable [QGVAR(isLimping), _isLimping, true];
|
2016-09-30 09:52:05 +00:00
|
|
|
|
2016-10-07 03:10:43 +00:00
|
|
|
// refresh
|
|
|
|
private _isDamaged = _unit getHitPointDamage "HitLegs" >= DAMAGED_MIN_THRESHOLD && {_unit getHitPointDamage "HitLegs" != LIMPING_MIN_DAMAGE};
|
|
|
|
|
|
|
|
[_unit, "Legs", _isDamaged] call FUNC(damageBodyPart);
|