Skip to content

Commit

Permalink
Only lua include files
Browse files Browse the repository at this point in the history
Previous fix didn't work before because explictly searching for *.lua meant that no directories got returned, so filtering during the loop instead
  • Loading branch information
MattJeanes committed Aug 2, 2019
1 parent 73326f0 commit 25e79cc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lua/pewpew_weaponhandler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,12 @@ function pewpew:LoadDirectory( Dir ) -- Thanks to Jcw87 for fixing this function

local entries,directories = file.Find( Dir .. "/*", "LUA")
for _, entry in ipairs ( entries ) do
if (SERVER) then
AddCSLuaFile( Dir .. "/" .. entry )
if string.EndsWith(entry, ".lua") then
if (SERVER) then
AddCSLuaFile( Dir .. "/" .. entry )
end
include( Dir .. "/" .. entry )
end
include( Dir .. "/" .. entry )
end
for _, directory in ipairs( directories ) do
self:LoadDirectory( Dir .. "/" .. directory )
Expand Down

0 comments on commit 25e79cc

Please sign in to comment.