Skip to content

Commit

Permalink
Fix an issue with identical combined data store retrievals
Browse files Browse the repository at this point in the history
  • Loading branch information
Kampfkarren committed Sep 2, 2019
1 parent 0896309 commit 56a0d27
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion DataStore2/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ do
self.combinedInitialGot = true
tableResult[self.combinedName] = clone(tableValue)
self.combinedStore:Set(tableResult, true)
return tableValue
return clone(tableValue)
end

function CombinedDataStore:Set(value, dontCallOnUpdate)
Expand Down
6 changes: 6 additions & 0 deletions Tests/tests/DataStore2.spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ return function()
dataStore:Increment(1)
expect(called).to.equal(true)
end)

it("should not return an identical value for default values", function()
local dataStore = DataStore2(UUID(), fakePlayer)
local data = {}
expect(dataStore:Get(data)).to.never.equal(data)
end)
end
end

Expand Down

0 comments on commit 56a0d27

Please sign in to comment.