mirror of
https://github.com/wiremod/wire.git
synced 2025-03-04 03:03:04 -05:00
Fix downloads when reloading file extension (#3234)
* Mitigate download issues with file extension * Simplify timer
This commit is contained in:
parent
4262b11969
commit
16d6d43ebf
@ -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
|
||||
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user