diff options
Diffstat (limited to 'gamemode/core/mapstich')
| -rw-r--r-- | gamemode/core/mapstich/cl_mapstich.lua | 9 | ||||
| -rw-r--r-- | gamemode/core/mapstich/sv_mapstich.lua | 2 |
2 files changed, 8 insertions, 3 deletions
diff --git a/gamemode/core/mapstich/cl_mapstich.lua b/gamemode/core/mapstich/cl_mapstich.lua index 62cad3f..6f85eeb 100644 --- a/gamemode/core/mapstich/cl_mapstich.lua +++ b/gamemode/core/mapstich/cl_mapstich.lua @@ -1,9 +1,14 @@ --[[ The client constantly cheks to see if we're in a serverchnage zone ]] -nrequire("sh_zones.lua") +if not nrequire("sh_zones.lua") then return end hook.Add("Think","artery_checklevelchange",function() - local z = LocalPlayer():GetCurrentZone() + local z + pcall(function() + z = LocalPlayer():GetCurrentZone() + end,function() + --This happens ocasionally when the player has loaded, and is running lua, but the LocalPlayer() entity isn't valid yet. + end) --print("looks like i'm in zone",z) if z then net.Start("art_zonechange") diff --git a/gamemode/core/mapstich/sv_mapstich.lua b/gamemode/core/mapstich/sv_mapstich.lua index 0a20828..91b4ec2 100644 --- a/gamemode/core/mapstich/sv_mapstich.lua +++ b/gamemode/core/mapstich/sv_mapstich.lua @@ -1,6 +1,6 @@ --Make sure zones are loaded already nrequire("sv_mysqlite.lua") -nrequire("sh_zones.lua") +if not nrequire("sh_zones.lua") then return end local q = nrequire("core/database/sv_queries.lua") --if not zones then error("This thing needs zones to function!") end |
