Skip to content

Commit

Permalink
fix: fix first person spectate not hiding pac items correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinFunk committed Feb 18, 2018
1 parent c361715 commit 962dfd0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/ps2/client/cl_0_pointshop2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,16 @@ end )
-- Hide 1st person spectated player's parts
function Pointshop2.HidePacOnSpectate( )
if LocalPlayer( ):GetObserverMode() == OBS_MODE_IN_EYE then
print("Pac Ignore")
local ply = LocalPlayer( ):GetObserverTarget( )
LocalPlayer( ).lastSpecTarget = ply
if IsValid( ply ) then
pac.ToggleIgnoreEntity( ply, true, "ps2_spectate_firstperson" )
for k,v in pairs(ply.pac_outfits) do v:SetHide(true) end
end
else
local ply = LocalPlayer( ).lastSpecTarget
if IsValid( ply ) then
pac.ToggleIgnoreEntity( ply, false, "ps2_spectate_firstperson" )
for k,v in pairs(ply.pac_outfits) do v:SetHide(false) end
LocalPlayer( ).lastSpecTarget = nil
end
end
Expand Down

0 comments on commit 962dfd0

Please sign in to comment.