Skip to content

Commit

Permalink
Prevent monitor resuming while bounding box is disabled
Browse files Browse the repository at this point in the history
This change prevents part monitoring for the bounding box module
from being resumed if the bounding box module is disabled. It
should fix an issue where the bounding box flickers to previous
calculated static extents if handles are let go after switching
tools, since this triggered resuming after the module had already
performed its clean-up procedure, leaving redundant untracked
monitors running.

Signed-off-by: Robert Chiquini <[email protected]>
  • Loading branch information
GigsD4X committed May 2, 2017
1 parent 3b95427 commit c4baa3a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions BoundingBoxModule.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ end;
function AddStaticPartMonitor(Part)
-- Monitors the given part to track when it is no longer static

-- Ensure part isn't already monitored
if not StaticPartsIndex[Part] then
-- Ensure part is static and isn't already monitored
if not StaticPartsIndex[Part] or StaticPartMonitors[Part] then
return;
end;

Expand Down Expand Up @@ -314,6 +314,11 @@ end;
function BoundingBoxModule.ResumeMonitoring()
-- Starts update loop and part monitors for selected and indexed parts

-- Ensure bounding box is enabled
if not BoundingBoxEnabled then
return;
end;

-- Start static part monitors
for StaticPart in pairs(StaticPartsIndex) do
AddStaticPartMonitor(StaticPart);
Expand Down

0 comments on commit c4baa3a

Please sign in to comment.