Skip to content

Commit

Permalink
Change warning detection.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheNexusAvenger committed Nov 13, 2022
1 parent 3e1c18b commit 1aa0c85
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Interaction/VRPointing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,13 @@ end
local DeprecationNoticePrinted = false
local OriginalWrappedInstanceNew = NexusWrappedInstance.__new
function NexusWrappedInstance.__new(...)
if not DeprecationNoticePrinted and not string.find(debug.traceback("", 2), "VRPointing") then
DeprecationNoticePrinted = true
warn(DEPRECATION_WARNING)
local Traceback = debug.traceback("", 2)
if not DeprecationNoticePrinted and not string.find(Traceback, "VRPointing") and not string.find(Traceback, "NexusButton") and not string.find(Traceback, "NexusVRCharacterModel.UI") then
local Type = ({...})[2]
if (typeof(Type) == "string" and Type ~= "Part" and Type ~= "SurfaceGui" and Type ~= "ScreenGui") or (typeof(Type) == "Instance" and not Type:IsA("SurfaceGui") and not Type:IsA("ScreenGui") and not Type:IsA("Part")) then
DeprecationNoticePrinted = true
warn(DEPRECATION_WARNING)
end
end
return OriginalWrappedInstanceNew(...)
end
Expand Down

0 comments on commit 1aa0c85

Please sign in to comment.