Files
wnsrc/lua/lvs_framework/init.lua
lifestorm 9c918c46e5 Upload
2024-08-04 23:12:27 +03:00

109 lines
2.4 KiB
Lua

--[[
| This file was obtained through the combined efforts
| of Madbluntz & Plymouth Antiquarian Society.
|
| Credits: lifestorm, Gregory Wayne Rossel JR.,
| Maloy, DrPepper10 @ RIP, Atle!
|
| Visit for more: https://plymouth.thetwilightzone.ru/
--]]
local StartTime = SysTime()
if SERVER then
AddCSLuaFile("includes/circles/circles.lua")
end
local function FileIsEmpty( filename )
if file.Size( filename, "LUA" ) <= 1 then -- this is suspicous
local data = file.Read( filename, "LUA" )
if data and string.len( data ) <= 1 then -- confirm its empty
print("[LVS] - refusing to load '"..filename.."'! File is Empty!" )
return true
end
end
return false
end
for _, filename in pairs( file.Find("lvs_framework/autorun/*.lua", "LUA") ) do
if FileIsEmpty( "lvs_framework/autorun/"..filename ) then continue end
if string.StartWith( filename, "sv_") then -- sv_ prefix only load serverside
if SERVER then
include("lvs_framework/autorun/"..filename)
end
continue
end
if string.StartWith( filename, "cl_") then -- cl_ prefix only load clientside
if SERVER then
AddCSLuaFile("lvs_framework/autorun/"..filename)
else
include("lvs_framework/autorun/"..filename)
end
continue
end
-- everything else is shared
if SERVER then
AddCSLuaFile("lvs_framework/autorun/"..filename)
end
include("lvs_framework/autorun/"..filename)
end
hook.Run( "LVS:Initialize" )
print("[LVS] - initialized ["..math.Round((SysTime() - StartTime) * 1000,2).."ms]")
if CLIENT then
hook.Add( "InitPostEntity", "!!!lvscheckupdates", function()
timer.Simple(20, function()
LVS.CheckUpdates()
local convar = GetConVar( "no_error_hitboxes" )
if not convar then return end
convar:SetBool( false )
end)
end )
return
end
resource.AddWorkshop("2912816023")
function LVS:FixVelocity()
local tbl = physenv.GetPerformanceSettings()
if tbl.MaxVelocity < 4000 then
local OldVel = tbl.MaxVelocity
tbl.MaxVelocity = 4000
physenv.SetPerformanceSettings(tbl)
print("[LVS] Low MaxVelocity detected! Increasing! "..OldVel.." => 4000")
end
if tbl.MaxAngularVelocity < 7272 then
local OldAngVel = tbl.MaxAngularVelocity
tbl.MaxAngularVelocity = 7272
physenv.SetPerformanceSettings(tbl)
print("[LVS] Low MaxAngularVelocity detected! Increasing! "..OldAngVel.." => 7272")
end
end
hook.Add( "InitPostEntity", "!!!lvscheckupdates", function()
timer.Simple(20, function()
LVS.CheckUpdates()
end)
end )