Skip to content

Commit

Permalink
double-check to exit calcview hook if editor is not active
Browse files Browse the repository at this point in the history
specific camera part setups caused issues

also, apply orthographic view preference before going in the editor
  • Loading branch information
pingu7867 committed Dec 26, 2024
1 parent 4a8523d commit 78d1f05
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lua/pac3/editor/client/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pace.camera_roll_drag_bind = CreateClientConVar("pac_editor_camera_roll_bind", "
pace.roll_snapping = CreateClientConVar("pac_camera_roll_snap", "0", true)

pace.camera_orthographic_cvar = CreateClientConVar("pac_camera_orthographic", "0", true)
pace.camera_orthographic = false
pace.camera_orthographic = pace.camera_orthographic_cvar:GetBool()
pace.viewlock_mode = ""

function pace.OrthographicView(b)
Expand Down Expand Up @@ -502,6 +502,7 @@ pace.view_reversed = 1
pace.viewlock_distance = 75

function pace.CalcView(ply, pos, ang, fov)
if not pace.IsActive() then pace.EnableView(false) return end
if pace.editing_viewmodel or pace.editing_hands then
pace.ViewPos = pos
pace.ViewAngles = ang
Expand Down Expand Up @@ -658,8 +659,7 @@ function pace.CalcView(ply, pos, ang, fov)
pace.ViewAngles_postRoll:RotateAroundAxis(pace.ViewAngles:Forward(), pace.view_roll)
viewang_final = pace.ViewAngles_postRoll
end

local orthoborder = pace.Editor.zoomslider:GetValue() / 1000

if not pace.camera_orthographic then
return
{
Expand All @@ -668,6 +668,7 @@ function pace.CalcView(ply, pos, ang, fov)
fov = pace.ViewFOV
}
else
local orthoborder = pace.Editor.zoomslider:GetValue() / 1000
return
{
origin = pace.ViewPos,
Expand Down

0 comments on commit 78d1f05

Please sign in to comment.