aboutsummaryrefslogtreecommitdiff
path: root/gamemode/core/npc/sh_npcsystem.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/core/npc/sh_npcsystem.lua')
-rw-r--r--gamemode/core/npc/sh_npcsystem.lua15
1 files changed, 10 insertions, 5 deletions
diff --git a/gamemode/core/npc/sh_npcsystem.lua b/gamemode/core/npc/sh_npcsystem.lua
index 9b43965..5b93f1e 100644
--- a/gamemode/core/npc/sh_npcsystem.lua
+++ b/gamemode/core/npc/sh_npcsystem.lua
@@ -115,11 +115,16 @@ local function loadMap()
local foldername = "artery/maps/" .. mapname
ExecuteOnFolder(foldername,true,function(path)
- print("I want to run",path)
- local filetxt = file.Read(path,"DATA")
- --print("File text is", filetxt)
- CompileString(filetxt,path)()
- --print("I want to execute",path)
+ local filename = path:match("/([^/]+)$")
+ print("I want to run",path, ";", filename)
+ local is_server = filename:match("^sv_")
+ local is_client = filename:match("^cl_")
+ if (is_client and CLIENT) or (is_server and SERVER) or (not is_server and not is_client) then
+ local filetxt = file.Read(path,"DATA")
+ --print("File text is", filetxt)
+ CompileString(filetxt,path)()
+ --print("I want to execute",path)
+ end
end)
end