mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Improved handling of accessing dynamic variable names
This commit is contained in:
parent
a315596c5a
commit
c3c39150a3
@ -25,8 +25,8 @@ _proximityPlayers = [ACE_player, GVAR(maxRange)] call FUNC(getProximityPlayers);
|
||||
_nameSane = [name _x] call FUNC(sanitizeName);
|
||||
_drawPosVariableName = format [QGVAR(%1_DrawPos), _nameSane];
|
||||
if (!isNil _drawPosVariableName) then {
|
||||
if (isNil {call compile _drawPosVariableName}) then {call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];};
|
||||
_pos = call compile _drawPosVariableName;
|
||||
if (isNil {missionNamespace getVariable _drawPosVariableName}) then {missionNamespace setVariable [_drawPosVariableName, [1, 1, 1]];};
|
||||
_pos = missionNamespace getVariable _drawPosVariableName;
|
||||
if (alive _x &&
|
||||
{_x getVariable QGVAR(Transmit)}) then {
|
||||
_group = group _x;
|
||||
|
@ -18,7 +18,7 @@
|
||||
{
|
||||
if (isPlayer _x) then {
|
||||
_nameSane = [name _x] call FUNC(sanitizeName);
|
||||
call compile format [QUOTE(GVAR(%1_DrawPos) = [ARR_3(1,1,1)];), _nameSane];
|
||||
missionNamespace setVariable [format [QGVAR(%1_DrawPos), _nameSane], [1, 1, 1]];
|
||||
};
|
||||
nil
|
||||
} count allUnits;
|
||||
|
@ -36,7 +36,7 @@ GVAR(MouseMoveHandlerID) = _mapCtrl ctrlAddEventHandler ["MouseMoving", {
|
||||
};
|
||||
|
||||
_nameSane = [name ACE_player] call FUNC(sanitizeName);
|
||||
call compile format [QUOTE(GVAR(%1_DrawPos) = %2), _nameSane, _control ctrlMapScreenToWorld [_posX, _posY]];
|
||||
missionNamespace setVariable [format [QGVAR(%1_DrawPos), _nameSane], _control ctrlMapScreenToWorld [_posX, _posY]];
|
||||
};
|
||||
}];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user