From efb61d96723e7ed41bb5a49ddbe25923025d2a26 Mon Sep 17 00:00:00 2001 From: Chev Date: Sat, 19 Apr 2025 22:35:58 -0700 Subject: [PATCH] SprayMesh Extended: Fix layout breaking if adding an existing spray It used old code where the spray was inside a container panel. The container panel isn't used anymore, calling GetParent would mistakenly remove the DIconLayout --- addons/spraymesh_extended/lua/vgui/dsprayconfiguration.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/spraymesh_extended/lua/vgui/dsprayconfiguration.lua b/addons/spraymesh_extended/lua/vgui/dsprayconfiguration.lua index 5993d78..b79de9d 100644 --- a/addons/spraymesh_extended/lua/vgui/dsprayconfiguration.lua +++ b/addons/spraymesh_extended/lua/vgui/dsprayconfiguration.lua @@ -362,8 +362,8 @@ local MAT_FAKE_TRANSPARENT = Material("spraymesh/fake_transparent.png", "noclamp function PANEL:AddSpray(url, name) -- If the spray already exists local existingSpray = self.Sprays[url] - if existingSpray and IsValid(existingSpray) and IsValid(existingSpray:GetParent()) then - existingSpray:GetParent():Remove() + if existingSpray and IsValid(existingSpray) then + existingSpray:Remove() self.Sprays[url] = nil end