From af696b454beeba24d5e2ad034856f9f2f326eba0 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Fri, 5 Mar 2021 19:47:04 -0300 Subject: [PATCH] Fix for not finding the coords for nil when an enemy dies in battleground --- classes/class_utility.lua | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/classes/class_utility.lua b/classes/class_utility.lua index f45ed68c1..2606b0706 100644 --- a/classes/class_utility.lua +++ b/classes/class_utility.lua @@ -604,13 +604,26 @@ function atributo_misc:DeadAtualizarBarra (morte, whichRowLine, colocacao, insta esta_barra.icone_classe:SetTexture (instancia.row_info.spec_file) esta_barra.icone_classe:SetTexCoord (_unpack (_detalhes.class_specs_coords [spec])) else - esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) - esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [morte[4]])) --no tcoords on morte[4] + if (CLASS_ICON_TCOORDS [morte[4]]) then + esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) + esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [morte[4]])) + else + local texture, l, r, t, b = Details:GetUnknownClassIcon() + esta_barra.icone_classe:SetTexture(texture) + esta_barra.icone_classe:SetTexCoord(l, r, t, b) + end end else - esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) - esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [morte[4]])) + if (CLASS_ICON_TCOORDS [morte[4]]) then + esta_barra.icone_classe:SetTexture (instancia.row_info.icon_file) + esta_barra.icone_classe:SetTexCoord (_unpack (CLASS_ICON_TCOORDS [morte[4]])) + else + local texture, l, r, t, b = Details:GetUnknownClassIcon() + esta_barra.icone_classe:SetTexture(texture) + esta_barra.icone_classe:SetTexCoord(l, r, t, b) + end end + esta_barra.icone_classe:SetVertexColor (1, 1, 1) if (esta_barra.mouse_over and not instancia.baseframe.isMoving) then --> precisa atualizar o tooltip