mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
742626ff1a
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
30 lines
703 B
Plaintext
30 lines
703 B
Plaintext
#include "..\script_component.hpp"
|
|
/*
|
|
* Author: commy2
|
|
* Sets the name variable of the object. Used to prevent issues with the name command.
|
|
*
|
|
* Arguments:
|
|
* 0: Object <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Example:
|
|
* [bob] call ace_common_fnc_setName
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
params ["_unit"];
|
|
TRACE_3("setName",_unit,alive _unit,name _unit);
|
|
|
|
if (isNull _unit || {!alive _unit}) exitWith {};
|
|
|
|
if (_unit isKindOf "CAManBase") then {
|
|
private _sanitizedName = [name _unit, true] call FUNC(sanitizeString);
|
|
private _rawName = [name _unit, false] call FUNC(sanitizeString);
|
|
|
|
_unit setVariable ["ACE_Name", _sanitizedName, true];
|
|
_unit setVariable ["ACE_NameRaw", _rawName, true];
|
|
};
|