Skip to content

Commit

Permalink
Rev. B55
Browse files Browse the repository at this point in the history
  • Loading branch information
hoontee committed Jan 29, 2024
1 parent c0d8336 commit 6da3eb2
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Pronghorn/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,22 @@ type Module = {
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

local function addModules(allModules: {Module}, object: Instance)
for _, child in object:GetChildren() do
if child:IsA("ModuleScript") then
if child ~= script then
table.insert(allModules, {Object = child, Return = require(child) :: any})
if object ~= script then
if object:IsA("ModuleScript") then
local alreadyAdded = false
for _, moduleTable in allModules do
if moduleTable.Object == object then
alreadyAdded = true
break
end
end
if not alreadyAdded then
table.insert(allModules, {Object = object, Return = require(object) :: any})
end
else
addModules(allModules, child)
for _, child in object:GetChildren() do
addModules(allModules, child)
end
end
end
end
Expand Down

0 comments on commit 6da3eb2

Please sign in to comment.