isaacscript-common 1.2.212 → 1.2.213
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,7 +5,7 @@ local Map = ____lualib.Map
|
|
|
5
5
|
local __TS__InstanceOf = ____lualib.__TS__InstanceOf
|
|
6
6
|
local __TS__Iterator = ____lualib.__TS__Iterator
|
|
7
7
|
local ____exports = {}
|
|
8
|
-
local isTSTLClass, copyClass, getNewClassFromMetatable, deepCopyValue, checkMetatable, validateValue, TSTL_CLASS_KEYS
|
|
8
|
+
local isTSTLClass, copyClass, getNewClassFromMetatable, deepCopyValue, checkMetatable, validateValue, isCopyableIsaacAPIClass, TSTL_CLASS_KEYS
|
|
9
9
|
local ____DefaultMap = require("classes.DefaultMap")
|
|
10
10
|
local DefaultMap = ____DefaultMap.DefaultMap
|
|
11
11
|
local ____SerializationBrand = require("enums.private.SerializationBrand")
|
|
@@ -15,6 +15,8 @@ local ____SerializationType = require("enums.SerializationType")
|
|
|
15
15
|
local SerializationType = ____SerializationType.SerializationType
|
|
16
16
|
local ____constants = require("features.saveDataManager.constants")
|
|
17
17
|
local SAVE_DATA_MANAGER_DEBUG = ____constants.SAVE_DATA_MANAGER_DEBUG
|
|
18
|
+
local ____color = require("functions.color")
|
|
19
|
+
local isColor = ____color.isColor
|
|
18
20
|
local ____log = require("functions.log")
|
|
19
21
|
local log = ____log.log
|
|
20
22
|
local ____rng = require("functions.rng")
|
|
@@ -236,12 +238,15 @@ function checkMetatable(self, ____table, traversalDescription)
|
|
|
236
238
|
error(("The deepCopy function detected that \"" .. tableDescription) .. "\" has a metatable. Copying tables with metatables is not supported, unless they are explicitly handled by the save data manager. (e.g. Vectors, TypeScriptToLua Maps, etc.)")
|
|
237
239
|
end
|
|
238
240
|
function validateValue(self, value, valueType, traversalDescription)
|
|
239
|
-
if
|
|
241
|
+
if isCopyableIsaacAPIClass(nil, value) then
|
|
240
242
|
return
|
|
241
243
|
end
|
|
242
244
|
if valueType == "function" or valueType == "nil" or valueType == "thread" or valueType == "userdata" then
|
|
243
|
-
error(((("The deepCopy function detected that \"" .. traversalDescription) .. "\"
|
|
245
|
+
error(((("The deepCopy function detected that \"" .. traversalDescription) .. "\" has a value of type \"") .. valueType) .. "\", which is not supported.")
|
|
244
246
|
end
|
|
245
247
|
end
|
|
248
|
+
function isCopyableIsaacAPIClass(self, value)
|
|
249
|
+
return isColor(nil, value) or isRNG(nil, value) or isVector(nil, value)
|
|
250
|
+
end
|
|
246
251
|
TSTL_CLASS_KEYS = __TS__New(Set, {"____constructor", "__index", "constructor"})
|
|
247
252
|
return ____exports
|