Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix downloads when reloading file extension #3234

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions lua/entities/gmod_wire_expression2/core/files.lua
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ util.AddNetworkString("wire_expression2_file_download")
-- 2 - Upload
-- 3 - End

timer.Remove("wire_expression2_flush_file_buffer") -- Remove this timer in case it exists from reloading
flushFileBuffer = function()
for ply, queue in pairs(downloads) do
if ent_IsValid(ply) then
Expand All @@ -350,8 +351,8 @@ flushFileBuffer = function()

table.remove(queue, 1)

if #queue ~= 0 and not timer.Exists("wire_expression2_flush_file_buffer") then -- Queue the next file
timer.Create("wire_expression2_flush_file_buffer", 0.2, 0, flushFileBuffer)
if #queue ~= 0 then -- Queue the next file
timer.Create("wire_expression2_flush_file_buffer", 0.2, 2, flushFileBuffer)
end
end)
net.Send(ply)
Expand Down
Loading