Update PatchTree and applyPatch to skip TouchTransmitter instances during patch processing

- Modified the logic in PatchTree.build and applyPatch functions to skip instances of ClassName "TouchTransmitter", which are auto-created by Roblox for touch events.
- This change enhances the efficiency of patch applications by preventing unnecessary processing of these instances.
This commit is contained in:
Joe 2026-01-20 22:54:07 -06:00
parent aa09717545
commit c5c6bf9a10
3 changed files with 6 additions and 6 deletions

View file

@ -27,9 +27,9 @@ local function applyPatch(instanceMap, patch)
local deferredRefs = {}
for _, removedIdOrInstance in ipairs(patch.removed) do
-- Skip TouchInterest (auto-created by Roblox when touch events are connected)
-- Skip TouchTransmitter (auto-created by Roblox when touch events are connected)
local instance = if Types.RbxId(removedIdOrInstance) then instanceMap.fromIds[removedIdOrInstance] else removedIdOrInstance
if instance and instance.ClassName == "TouchInterest" then
if instance and instance.ClassName == "TouchTransmitter" then
continue
end

View file

@ -335,8 +335,8 @@ local function diff(instanceMap, virtualInstances, rootId)
-- corresponding virtual instance should be removed. Any instance that
-- does have a corresponding virtual instance is recursively diffed.
for _, childInstance in ipairs(instance:GetChildren()) do
-- Skip TouchInterest (auto-created by Roblox when touch events are connected)
if childInstance.ClassName == "TouchInterest" then
-- Skip TouchTransmitter (auto-created by Roblox when touch events are connected)
if childInstance.ClassName == "TouchTransmitter" then
continue
end