Skip to content

Commit 78d1f05

Browse files
committed
double-check to exit calcview hook if editor is not active
specific camera part setups caused issues also, apply orthographic view preference before going in the editor
1 parent 4a8523d commit 78d1f05

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lua/pac3/editor/client/view.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ pace.camera_roll_drag_bind = CreateClientConVar("pac_editor_camera_roll_bind", "
108108
pace.roll_snapping = CreateClientConVar("pac_camera_roll_snap", "0", true)
109109

110110
pace.camera_orthographic_cvar = CreateClientConVar("pac_camera_orthographic", "0", true)
111-
pace.camera_orthographic = false
111+
pace.camera_orthographic = pace.camera_orthographic_cvar:GetBool()
112112
pace.viewlock_mode = ""
113113

114114
function pace.OrthographicView(b)
@@ -502,6 +502,7 @@ pace.view_reversed = 1
502502
pace.viewlock_distance = 75
503503

504504
function pace.CalcView(ply, pos, ang, fov)
505+
if not pace.IsActive() then pace.EnableView(false) return end
505506
if pace.editing_viewmodel or pace.editing_hands then
506507
pace.ViewPos = pos
507508
pace.ViewAngles = ang
@@ -658,8 +659,7 @@ function pace.CalcView(ply, pos, ang, fov)
658659
pace.ViewAngles_postRoll:RotateAroundAxis(pace.ViewAngles:Forward(), pace.view_roll)
659660
viewang_final = pace.ViewAngles_postRoll
660661
end
661-
662-
local orthoborder = pace.Editor.zoomslider:GetValue() / 1000
662+
663663
if not pace.camera_orthographic then
664664
return
665665
{
@@ -668,6 +668,7 @@ function pace.CalcView(ply, pos, ang, fov)
668668
fov = pace.ViewFOV
669669
}
670670
else
671+
local orthoborder = pace.Editor.zoomslider:GetValue() / 1000
671672
return
672673
{
673674
origin = pace.ViewPos,

0 commit comments

Comments
 (0)