@rbxts/covenant 3.3.0 → 3.3.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/covenant.luau +18 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/covenant",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "main": "src/init.luau",
5
5
  "scripts": {
6
6
  "build": "rbxtsc",
package/src/covenant.luau CHANGED
@@ -247,6 +247,18 @@ do
247
247
  local _serverToClientEntityMap = self.serverToClientEntityMap
248
248
  local _stringifiedServerEntity = stringifiedServerEntity
249
249
  local entity = _serverToClientEntityMap[_stringifiedServerEntity]
250
+ if entityData == Delete then
251
+ if entity ~= nil then
252
+ self:worldDelete(entity)
253
+ end
254
+ local _serverToClientEntityMap_1 = self.serverToClientEntityMap
255
+ local _stringifiedServerEntity_1 = stringifiedServerEntity
256
+ _serverToClientEntityMap_1[_stringifiedServerEntity_1] = nil
257
+ local _clientToServerEntityMap = self.clientToServerEntityMap
258
+ local _arg0 = tostring(entity)
259
+ _clientToServerEntityMap[_arg0] = nil
260
+ return nil
261
+ end
250
262
  if entity == nil then
251
263
  entity = self._world:entity()
252
264
  local _serverToClientEntityMap_1 = self.serverToClientEntityMap
@@ -258,16 +270,6 @@ do
258
270
  local _arg1 = tonumber(stringifiedServerEntity)
259
271
  _clientToServerEntityMap[_arg0] = _arg1
260
272
  end
261
- if entityData == Delete then
262
- self:worldDelete(entity)
263
- local _serverToClientEntityMap_1 = self.serverToClientEntityMap
264
- local _stringifiedServerEntity_1 = stringifiedServerEntity
265
- _serverToClientEntityMap_1[_stringifiedServerEntity_1] = nil
266
- local _clientToServerEntityMap = self.clientToServerEntityMap
267
- local _arg0 = tostring(entity)
268
- _clientToServerEntityMap[_arg0] = nil
269
- return nil
270
- end
271
273
  -- ▼ ReadonlyMap.forEach ▼
272
274
  local _callback_2 = function(state, stringifiedComponent)
273
275
  local component = tonumber(stringifiedComponent)
@@ -438,11 +440,12 @@ do
438
440
  local _clientToServerEntityMap = self.clientToServerEntityMap
439
441
  local _arg0_2 = tostring(entity)
440
442
  local serverEntity = _clientToServerEntityMap[_arg0_2]
441
- assert(serverEntity ~= 0 and serverEntity == serverEntity and serverEntity, "This entity should exist.")
442
- local _componentChanges = componentChanges
443
- local _arg0_3 = tostring(serverEntity)
444
- local _arg1 = if newState ~= nil then newState else Remove
445
- _componentChanges[_arg0_3] = _arg1
443
+ if serverEntity ~= nil then
444
+ local _componentChanges = componentChanges
445
+ local _arg0_3 = tostring(serverEntity)
446
+ local _arg1 = if newState ~= nil then newState else Remove
447
+ _componentChanges[_arg0_3] = _arg1
448
+ end
446
449
  end
447
450
  end
448
451
  function Covenant:subscribeComponent(component, subscriber)