Skip to content

Commit a3f96e6

Browse files
authored
Merge pull request #3 from AtomicGmod/develop
fix client package loading
2 parents 9533879 + 18a0165 commit a3f96e6

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

lua/atomic/libraries/loader.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,34 @@ atomic.loader = atomic.loader or {
33
}
44

55
---@param path string
6+
---@return ...?
67
function atomic.loader.client(path)
78
if (SERVER) then
89
return AddCSLuaFile(path)
910
end
1011

1112
atomic.loader.logger:debug("including client file `%s`", path)
1213

13-
include(path)
14+
return include(path)
1415
end
1516

1617
---@param path string
18+
---@return ...?
1719
function atomic.loader.shared(path)
1820
if (SERVER) then
1921
AddCSLuaFile(path)
2022
end
2123

2224
atomic.loader.logger:debug("including shared file `%s`", path)
2325

24-
include(path)
26+
return include(path)
2527
end
2628

2729
---@param path string
30+
---@return ...?
2831
function atomic.loader.server(path)
2932
if (SERVER) then
3033
atomic.loader.logger:debug("including server file `%s`", path)
31-
include(path)
34+
return include(path)
3235
end
3336
end

lua/atomic/libraries/package/common.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function atomic.package.find(path, isInGamemode)
5454
local gameDir = isInGamemode and "GAME" or "LUA"
5555

5656
if file.Exists(pkg, gameDir) then
57-
local package = include(path .. "/package.lua")
57+
local package = atomic.loader.shared(path .. "/package.lua")
5858

5959
if (type(package) ~= "table") then
6060
return
@@ -71,7 +71,7 @@ function atomic.package.find(path, isInGamemode)
7171
for _, package in ipairs(packages) do
7272
local pkgPath = gameRelativePath .. "/" .. package .. "/package.lua"
7373
if file.Exists(pkgPath, gameDir) then
74-
local packageData = include(path .. "/" .. package .. "/package.lua")
74+
local packageData = atomic.loader.shared(path .. "/" .. package .. "/package.lua")
7575
packageData._path = path .. "/" .. package
7676
if type(packageData) == "table" then
7777
table.insert(result, packageData)

lua/autorun/atomic_autorun.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ atomic = {
22
meta = {
33
author = "smokingplaya",
44
version_name = "Feijoa",
5-
version = "0.2.0",
5+
version = "0.2.1",
66
}
77
}
88

0 commit comments

Comments
 (0)