mirror of
https://github.com/CapsAdmin/pac3.git
synced 2025-03-04 03:03:01 -05:00
fix proxies using Hide not cleaning up properly when hidden
This commit is contained in:
parent
fb4ef19b40
commit
d04c417752
@ -636,6 +636,28 @@ do -- hidden / events
|
||||
end
|
||||
end
|
||||
|
||||
function PART:GetReasonHidden()
|
||||
local found = {}
|
||||
|
||||
for part in pairs(self.active_events) do
|
||||
table.insert(found, tostring(part) .. " is event hiding")
|
||||
end
|
||||
|
||||
if found[1] then
|
||||
return table.concat(found, "\n")
|
||||
end
|
||||
|
||||
if self.Hide then
|
||||
return "hide enabled"
|
||||
end
|
||||
|
||||
if self.hide_disturbing then
|
||||
return "pac_hide_disturbing is set to 1"
|
||||
end
|
||||
|
||||
return ""
|
||||
end
|
||||
|
||||
function PART:CalcShowHide(from_rendering)
|
||||
local b = self:IsHidden()
|
||||
|
||||
|
@ -809,6 +809,18 @@ function PART:OnHide()
|
||||
self.last_pos = nil
|
||||
self.last_vel_smooth = nil
|
||||
end
|
||||
|
||||
if self.VariableName == "Hide" then
|
||||
-- cleanup event triggers on hide
|
||||
local part = self:GetTarget()
|
||||
if self.AffectChildren then
|
||||
for _, part in ipairs(self:GetChildren()) do
|
||||
part:SetEventTrigger(self, false)
|
||||
end
|
||||
else
|
||||
part:SetEventTrigger(self, false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PART:OnShow()
|
||||
|
Loading…
Reference in New Issue
Block a user