mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Nametags - Fix ACE nametag drawIcon3D parameter error when player controlled unit dies (#8764)
* FIX: `_icon` can be `nil` * Migrate from `if` to `switch` * Missing ()
This commit is contained in:
@ -29,19 +29,26 @@ _fnc_parameters = {
|
|||||||
params ["_player", "_target", "_alpha", "_heightOffset", "_drawName", "_drawRank", "_drawSoundwave"];
|
params ["_player", "_target", "_alpha", "_heightOffset", "_drawName", "_drawRank", "_drawSoundwave"];
|
||||||
|
|
||||||
//Set Icon:
|
//Set Icon:
|
||||||
private _icon = "";
|
private _targetIcon = _target getVariable QGVAR(rankIcon);
|
||||||
if (_drawSoundwave) then {
|
|
||||||
_icon = format [QPATHTOF(UI\soundwave%1.paa), floor random 10];
|
private _icon = switch true do {
|
||||||
} else {
|
case _drawSoundwave: {
|
||||||
if (_drawRank) then {
|
format [QPATHTOF(UI\soundwave%1.paa), floor random 10]
|
||||||
_icon = _target getVariable "ace_nametags_rankIcon";
|
};
|
||||||
if (isNil "_icon" && {rank _target != ""}) then {
|
|
||||||
_icon = GVAR(factionRanks) getVariable (_target getVariable [QGVAR(faction), faction _target]);
|
case !_drawRank: {""};
|
||||||
if (!isNil "_icon") then {
|
case !isNil "_targetIcon": {_targetIcon};
|
||||||
_icon = _icon param [ALL_RANKS find rank _target, ""];
|
case (rank _target == ""): {""};
|
||||||
} else {
|
|
||||||
_icon = format ["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank _target];
|
default {
|
||||||
};
|
private _targetFaction = _target getVariable [QGVAR(faction), faction _target];
|
||||||
|
private _customRankIcons = GVAR(factionRanks) getVariable _targetFaction;
|
||||||
|
|
||||||
|
if (!isNil "_customRankIcons") then {
|
||||||
|
_customRankIcons param [ALL_RANKS find rank _target, ""] // return
|
||||||
|
} else {
|
||||||
|
// default rank icons
|
||||||
|
format ["\A3\Ui_f\data\GUI\Cfg\Ranks\%1_gs.paa", rank _target] // return
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user