Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions lua/pac3/editor/server/wear.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local next = next

Check warning on line 1 in lua/pac3/editor/server/wear.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: next
local type = type
local istable = istable
local IsValid = IsValid
Expand Down Expand Up @@ -179,10 +179,10 @@

for key, v in pairs(pace.dupe_ents) do
if v.owner:IsValid() and v.owner == owner then
if v.ent:IsValid() and v.ent.pac_parts then
v.ent.pac_parts = nil
duplicator.ClearEntityModifier(v.ent, "pac_config")
end

Check warning on line 185 in lua/pac3/editor/server/wear.lua

View workflow job for this annotation

GitHub Actions / lint

"Double if-statement"

Double if statement. Please combine the condition of this if statement with that of the outer if statement using `and`.
end

pace.dupe_ents[key] = nil
Expand All @@ -205,7 +205,7 @@
end
end
else
players = player.GetAll()
players = player.GetHumans()
end

if filter == false then
Expand Down Expand Up @@ -255,12 +255,17 @@
end
end
end
elseif type(players) == "Player" and (not players.pac_requested_outfits and players ~= owner) then
data.transmissionID = nil
elseif type(players) == "Player" then
if (not players.pac_requested_outfits and players ~= owner) then
data.transmissionID = nil
return true
end
players = {players}
else
return true
end

if not players or istable(players) and not next(players) then return true end
if not players[1] then return true end

-- Alternative transmission system
local ret = pac.CallHook("SendData", players, data)
Expand Down Expand Up @@ -410,7 +415,7 @@
return
end
local buffer = pac.StringStream(data)
local ok,tbl = pcall(buffer.readTable, buffer)

Check warning on line 418 in lua/pac3/editor/server/wear.lua

View workflow job for this annotation

GitHub Actions / lint

"Space after comma"

Style: Please add a space after the comma
if ok then
pace.HandleReceivedData(ply, tbl)
end
Expand Down
Loading