mirror of
https://github.com/JonnyBro/beatrun.git
synced 2024-12-28 12:53:02 +05:00
Merge pull request #22 from jeffthekillerz/master
This commit is contained in:
commit
b679623a5b
8 changed files with 22 additions and 12 deletions
|
@ -1,6 +1,7 @@
|
|||
include("shared.lua")
|
||||
|
||||
for k, v in ipairs(file.Find("beatrun/gamemode/cl/*.lua", "LUA")) do
|
||||
print(v)
|
||||
for k, v in ipairs(file.Find("gamemodes/beatrun/gamemode/cl/*.lua", "GAME", "nameasc")) do
|
||||
include("cl/" .. v)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
|
@ -2,16 +2,18 @@ AddCSLuaFile("cl_init.lua")
|
|||
AddCSLuaFile("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)
|
||||
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)
|
||||
include("sh/" .. v)
|
||||
AddCSLuaFile("sh/" .. v)
|
||||
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)
|
||||
end
|
|
@ -8,7 +8,7 @@ GM.Email = "datae@dontemailme.com"
|
|||
GM.Website = "www.mirrorsedge.com"
|
||||
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)
|
||||
include("sh/" .. v)
|
||||
end
|
|
@ -626,17 +626,24 @@ hook.Add("NeedsDepthPass", "VManip_RubatPLZ", function()
|
|||
VManip.Attachment = att
|
||||
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)
|
||||
-- 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
|
||||
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 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 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])
|
||||
|
|
Loading…
Reference in a new issue