diff --git a/lua/entities/starfall_processor/cl_init.lua b/lua/entities/starfall_processor/cl_init.lua index 7f9b5dc59..80b2a2c22 100644 --- a/lua/entities/starfall_processor/cl_init.lua +++ b/lua/entities/starfall_processor/cl_init.lua @@ -130,7 +130,7 @@ hook.Add("StarfallError", "StarfallErrorReport", function(_, owner, client, main if not IsValid(owner) then return end local local_player = LocalPlayer() if owner == local_player then - if not client or client == owner then + if client:IsWorld() or client == owner then SF.AddNotify(owner, message, "ERROR", 7, "ERROR1") elseif client then if should_notify then diff --git a/lua/entities/starfall_processor/shared.lua b/lua/entities/starfall_processor/shared.lua index 349afee60..9ac9e1794 100644 --- a/lua/entities/starfall_processor/shared.lua +++ b/lua/entities/starfall_processor/shared.lua @@ -135,7 +135,7 @@ function ENT:Error(err) self:SetColor(Color(255, 0, 0, 255)) end - hook.Run("StarfallError", self, self.owner, CLIENT and LocalPlayer() or false, self.sfdata and self.sfdata.mainfile or "", msg, traceback) + hook.Run("StarfallError", self, self.owner, CLIENT and LocalPlayer() or Entity(0), self.sfdata and self.sfdata.mainfile or "", msg, traceback) SF.SendError(self, msg, traceback) end diff --git a/lua/starfall/libs_sh/hook.lua b/lua/starfall/libs_sh/hook.lua index b61b14311..6601ea66a 100644 --- a/lua/starfall/libs_sh/hook.lua +++ b/lua/starfall/libs_sh/hook.lua @@ -575,7 +575,7 @@ add("Tick") -- @param Player|Entity ply Who's fault it errored. World-entity if it was a server error, or player that the script errored if on client -- @param string err Error message add("StarfallError", nil, function(instance, ent, owner, errply, _, err) - return true, {instance.WrapObject(ent), instance.WrapObject(errply or Entity(0)), err} + return true, {instance.WrapObject(ent), instance.WrapObject(errply), err} end) -- Game Events diff --git a/lua/starfall/transfer.lua b/lua/starfall/transfer.lua index 7b7f1a7bf..d7638b23f 100644 --- a/lua/starfall/transfer.lua +++ b/lua/starfall/transfer.lua @@ -251,7 +251,6 @@ else callback = callback - 1 if callback>0 then return end if chip and owner and client then - if client:IsWorld() then client = nil end hook.Run("StarfallError", chip, owner, client, mainfile, message, traceback, should_notify) end end