Fix small autorefresh bug when working on server modules.

This commit is contained in:
SticklyMan 2015-12-12 19:53:04 -07:00
parent 3265898bac
commit 7085e21998
2 changed files with 7 additions and 1 deletions

View File

@ -78,6 +78,12 @@ function xgui.init()
xgui.readyPlayers = {} --Set up a table to store users who are ready to receive data.
function xgui.addDataType( name, retrievalFunc, access, maxChunkSize, priority )
xgui.dataTypes[name] = { getData=retrievalFunc, access=access, maxchunk=maxChunkSize }
-- For autorefresh- ensure priorities for a datatype are never added more than once
for i=#xgui.dataTypes, 1, -1 do
if xgui.dataTypes[i].name == name then
table.remove( xgui.dataTypes, i )
end
end
table.insert( xgui.dataTypes, { name=name, priority=priority or 0 } )
table.sort( xgui.dataTypes, function(a,b) return a.priority < b.priority end )
end

View File

@ -1 +1 @@
1449963483
1449975185