mirror of
https://github.com/CFC-Servers/cfc_chip_lister.git
synced 2025-03-04 03:03:14 -05:00
Still check for players using the HUD even if no lister ents are spawned (#12)
* Still check for players using the HUD even if no lister ents are spawned * Clarity
This commit is contained in:
parent
75c6ccb1a7
commit
551f5c5c99
@ -115,9 +115,11 @@ local function isPlateVisible( ent, ply )
|
||||
end
|
||||
|
||||
-- Can a player see at least one chip lister?
|
||||
-- Give listers as false to only check for the HUD setting (i.e. no lister entities exist).
|
||||
local function canSeeALister( ply, listers )
|
||||
if not IsValid( ply ) then return false end
|
||||
if ply:GetInfoNum( "cfc_chiplister_hud_persist", 0 ) == 1 then return true end
|
||||
if not listers then return false end
|
||||
|
||||
local aimEnt = ply:GetEyeTrace().Entity
|
||||
if IsValid( aimEnt ) and aimEnt:GetClass() == "cfc_chip_lister" then return true end
|
||||
@ -134,7 +136,10 @@ local function getVisibleListUsers()
|
||||
if listUserCount == 0 then return {}, 0 end
|
||||
|
||||
local listers = ents.FindByClass( "cfc_chip_lister" )
|
||||
if #listers == 0 then return {}, 0 end
|
||||
|
||||
if #listers == 0 then
|
||||
listers = false
|
||||
end
|
||||
|
||||
local visibleUsers = {}
|
||||
local visibleUserCount = 0
|
||||
|
Loading…
Reference in New Issue
Block a user