2023-09-12 18:58:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* 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-01-11 16:42:31 +00:00
|
|
|
*
|
2015-09-17 16:25:02 +00:00
|
|
|
* Return Value:
|
|
|
|
* None
|
|
|
|
*
|
2017-06-08 13:31:51 +00:00
|
|
|
* Example:
|
|
|
|
* [bob] call ace_common_fnc_setName
|
|
|
|
*
|
2015-09-17 16:25:02 +00:00
|
|
|
* Public: No
|
2015-01-11 16:42:31 +00:00
|
|
|
*/
|
|
|
|
|
2015-09-17 16:25:02 +00:00
|
|
|
params ["_unit"];
|
2017-02-10 19:03:12 +00:00
|
|
|
TRACE_3("setName",_unit,alive _unit,name _unit);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
if (isNull _unit || {!alive _unit}) exitWith {};
|
|
|
|
|
|
|
|
if (_unit isKindOf "CAManBase") then {
|
2015-12-11 18:01:50 +00:00
|
|
|
private _sanitizedName = [name _unit, true] call FUNC(sanitizeString);
|
|
|
|
private _rawName = [name _unit, false] call FUNC(sanitizeString);
|
2016-03-29 11:59:07 +00:00
|
|
|
|
2015-12-11 18:01:50 +00:00
|
|
|
_unit setVariable ["ACE_Name", _sanitizedName, true];
|
|
|
|
_unit setVariable ["ACE_NameRaw", _rawName, true];
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|