Merge pull request #22 from jeffthekillerz/master

This commit is contained in:
Nikita 2023-06-22 11:42:40 +05:00 committed by GitHub
commit b679623a5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 22 additions and 12 deletions

View file

@ -1,6 +1,7 @@
include("shared.lua") include("shared.lua")
for k, v in ipairs(file.Find("beatrun/gamemode/cl/*.lua", "LUA")) do for k, v in ipairs(file.Find("gamemodes/beatrun/gamemode/cl/*.lua", "GAME", "nameasc")) do
print(v)
include("cl/" .. v) include("cl/" .. v)
end end

View file

@ -2,16 +2,18 @@ AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua") AddCSLuaFile("shared.lua")
include("shared.lua") include("shared.lua")
for k, v in ipairs(file.Find("beatrun/gamemode/cl/*.lua", "LUA")) do for k, v in ipairs(file.Find("gamemodes/beatrun/gamemode/cl/*.lua", "GAME", "nameasc")) do
print(v)
AddCSLuaFile("cl/" .. v) AddCSLuaFile("cl/" .. v)
end end
for k, v in ipairs(file.Find("beatrun/gamemode/sh/*.lua", "LUA")) do for k, v in ipairs(file.Find("gamemodes/beatrun/gamemode/sh/*.lua", "GAME", "nameasc")) do
print(v) print(v)
include("sh/" .. v) include("sh/" .. v)
AddCSLuaFile("sh/" .. v) AddCSLuaFile("sh/" .. v)
end end
for k, v in ipairs(file.Find("beatrun/gamemode/sv/*.lua", "LUA")) do for k, v in ipairs(file.Find("gamemodes/beatrun/gamemode/sv/*.lua", "GAME", "nameasc")) do
print(v)
include("sv/" .. v) include("sv/" .. v)
end end

View file

@ -8,7 +8,7 @@ GM.Email = "datae@dontemailme.com"
GM.Website = "www.mirrorsedge.com" GM.Website = "www.mirrorsedge.com"
include("player_class/player_beatrun.lua") include("player_class/player_beatrun.lua")
for k, v in ipairs(file.Find("beatrun/gamemode/sh/*.lua", "LUA")) do for k, v in ipairs(file.Find("gamemodes/beatrun/gamemode/sh/*.lua", "GAME", "nameasc")) do
AddCSLuaFile("sh/" .. v) AddCSLuaFile("sh/" .. v)
include("sh/" .. v) include("sh/" .. v)
end end

View file

@ -626,17 +626,24 @@ hook.Add("NeedsDepthPass", "VManip_RubatPLZ", function()
VManip.Attachment = att VManip.Attachment = att
end) end)
local ISCALC = false
local calcview_hooks = {}
timer.Simple(5, function()
calcview_hooks = hook.GetTable()["CalcView"]
end)
hook.Add("CalcView", "VManip_Cam", function(ply, origin, angles, fov) hook.Add("CalcView", "VManip_Cam", function(ply, origin, angles, fov)
-- we dont really care about camera manipulations from other hooks during this, thus we can ignore them. -- we dont really care about camera manipulations from other hooks during this, thus we can ignore them.
-- some important calculations can happen in calcview hooks however, so running them is important -- some important calculations can happen in calcview hooks however, so running them is important
if ISCALC then return end
ISCALC = true
hook.Run("CalcView", ply, pos, ang, fov)
ISCALC = false
if not VManip:IsActive() or not VManip.Attachment then return end if not VManip:IsActive() or not VManip.Attachment then return end
if ply:GetViewEntity() ~= ply or ply:ShouldDrawLocalPlayer() then return end if ply:GetViewEntity() ~= ply or ply:ShouldDrawLocalPlayer() then return end
for name, func in pairs(calcview_hooks) do
if name == "VManip_Cam" then continue end
func(ply, origin, angles, fov)
end
local view = {} local view = {}
local camang = VManip.Attachment.Ang - VManip.Cam_Ang local camang = VManip.Attachment.Ang - VManip.Cam_Ang
view.angles = angles + Angle(camang.x * VManip.Cam_AngInt[1], camang.y * VManip.Cam_AngInt[2], camang.z * VManip.Cam_AngInt[3]) view.angles = angles + Angle(camang.x * VManip.Cam_AngInt[1], camang.y * VManip.Cam_AngInt[2], camang.z * VManip.Cam_AngInt[3])