Skip to content

Commit

Permalink
A few small fixes (#1706)
Browse files Browse the repository at this point in the history
* A few small fixes

* Last fix
  • Loading branch information
thegrb93 authored Apr 9, 2024
1 parent 3bffc9c commit f7e500e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
3 changes: 2 additions & 1 deletion lua/entities/starfall_hologram/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ end

SF.WaitForPlayerInit(function(ply)
for k, v in ipairs(ents.FindByClass("starfall_hologram")) do
if #v.clipdata>0 then
local clipdata = v.clipdata
if clipdata and #clipdata>0 then
v:TransmitClips(ply)
end
end
Expand Down
1 change: 1 addition & 0 deletions lua/starfall/editor/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@ if CLIENT then
timer.Create("starfall_editor_status", 1 / 3, 0, function ()
rolldelta = -rolldelta
for ply, _ in pairs(busy_players) do
if not ply:IsValid() then continue end
local BoneIndx = ply:LookupBone("ValveBiped.Bip01_Head1") or ply:LookupBone("ValveBiped.HC_Head_Bone") or 0
local BonePos, BoneAng = ply:GetBonePosition(BoneIndx)
local particle = emitter:Add("radon/starfall2", BonePos + Vector(math.random(-10, 10), math.random(-10, 10), 60 + math.random(0, 10)))
Expand Down
26 changes: 16 additions & 10 deletions lua/starfall/sflib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1094,17 +1094,23 @@ end

function SF.EntIsReady(ent)
if ent:IsWorld() then return true end
if IsValid(ent) then
-- https://github.com/Facepunch/garrysmod-issues/issues/3127
local class = ent:GetClass()
if class=="player" then
return ent:IsPlayer()
else
local n = next(baseclass.Get(class))
return n==nil or ent[n]~=nil
end
if not IsValid(ent) then return false end

-- https://github.com/Facepunch/garrysmod-issues/issues/3127
local class = ent:GetClass()
if class=="player" then
return ent:IsPlayer()
elseif class=="starfall_processor" then
return ent.Starfall~=nil
elseif class=="starfall_hologram" then
return ent.IsSFHologram~=nil
elseif class=="starfall_prop" then
return ent.IsSFProp~=nil
elseif class=="starfall_screen" or class=="starfall_hud" then
return ent:IsScripted()
else
return true
end
return false
end

local waitingConditions = {}
Expand Down

0 comments on commit f7e500e

Please sign in to comment.