Skip to content

Commit

Permalink
added tick protection
Browse files Browse the repository at this point in the history
  • Loading branch information
nightcycle authored Sep 11, 2024
1 parent 3328fcb commit 153f3ad
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/DataSet/DataTable.luau
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local Util = require("../Util")
-- Constants
-- Variables
-- References
local LuneIndex = 0 --alternative to tick for lune
-- Private Functions
-- Class
-- Types
Expand Down Expand Up @@ -172,7 +173,17 @@ function DataTable:AddRow(param: { [string]: unknown })
end
end

self._BatchQueue:Add(compressedData, -tick())
local isLune = true
pcall(function()
local workspace = game:GetService("Workspace")
isLune = false
end)
if isLune then
LuneIndex += 1
self._BatchQueue:Add(compressedData, -LuneIndex)
else
self._BatchQueue:Add(compressedData, -tick())
end
end

function DataTable:SetKeyColumn(key: string)
Expand Down

0 comments on commit 153f3ad

Please sign in to comment.