acemod / ACE3

Open-source realism mod for Arma 3
https://ace3.acemod.org
Other
994 stars 735 forks source link

ACE nametag drawIcon3D parameter error when player controlled unit dies #8719

Closed GoldJohnKing closed 2 years ago

GoldJohnKing commented 2 years ago

Mods (complete and add to the following information):

Description: After recent update (I believe it should be since 3.14.0), I got this error when player disconnect / lose connection / return to lobby, if the player's nametag can be seen by me (in draw range).

20:19:12 Error in expression <ctorAdd [0,0,(_heightOffset + .3)])];

drawIcon3D _parameters;
>
20:19:12   Error position: <drawIcon3D _parameters;
>
20:19:12   Error type any,string expected
20:19:12 File z\ace\addons\nametags\functions\fnc_drawNameTagIcon.sqf..., line 93

Steps to reproduce: _Follow [https://ace3mod.com/img/wiki/user/issue_flowchart.png](this flowchart)!_

  1. 2 players join into the server, and can see each other's nametag.
  2. One player disconnect / lose connection / return to lobby.
  3. Another player can see the error pops up, or can see the error log in rpt file.

Expected behavior: The error should not happen. I believe I do not have the issue before ace 3.14.0 version.

Where did the issue occur?

Log Files:

Vdauphin commented 2 years ago

https://github.com/acemod/ACE3/blob/af86109c2b3c9ec05d134561cf99691b84c832ff/addons/nametags/functions/fnc_drawNameTagIcon.sqf#L37-L46 I am not entirely sure but if _icon is nil and rank _target != "" is false then _icon will be nil when called by drawIcon3D later. This may trigger the error Error type any,string expected

A simple fix would be: https://github.com/acemod/ACE3/pull/8764/files

~I may try to test it next year~ Today