ACE3/addons/common/functions/fnc_setName.sqf

26 lines
519 B
Plaintext
Raw Normal View History

/*
* Author: commy2
* Sets the name variable of the object. Used to prevent issues with the name command.
*
2015-09-17 16:25:02 +00:00
* Arguments:
* 0: Object <OBJECT>
*
2015-09-17 16:25:02 +00:00
* Return Value:
* None
*
* Public: No
*/
2015-01-13 19:56:02 +00:00
#include "script_component.hpp"
2015-09-17 16:25:02 +00:00
params ["_unit"];
if (isNull _unit || {!alive _unit}) exitWith {};
if (_unit isKindOf "CAManBase") then {
2015-05-14 18:06:06 +00:00
_name = [name _unit, true] call FUNC(sanitizeString);
2015-09-17 16:25:02 +00:00
2015-05-14 18:06:06 +00:00
//if (_name != _unit getVariable ["ACE_Name", ""]) then {
_unit setVariable ["ACE_Name", _name, true];
2015-05-14 18:06:06 +00:00
//};
};