@rbxts/covenant 3.2.1 → 3.2.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rbxts/covenant",
3
- "version": "3.2.1",
3
+ "version": "3.2.3",
4
4
  "main": "src/init.luau",
5
5
  "scripts": {
6
6
  "build": "rbxtsc",
package/src/covenant.d.ts CHANGED
@@ -20,7 +20,7 @@ export declare class Covenant {
20
20
  private systems;
21
21
  private worldChangesForReplication;
22
22
  private worldChangesForPrediction;
23
- private components;
23
+ private stringfiedComponents;
24
24
  private undefinedStringifiedComponents;
25
25
  private replicatedStringifiedComponents;
26
26
  private predictedStringifiedComponents;
package/src/covenant.luau CHANGED
@@ -41,7 +41,7 @@ do
41
41
  self.systems = EventMap.new()
42
42
  self.worldChangesForReplication = {}
43
43
  self.worldChangesForPrediction = {}
44
- self.components = {}
44
+ self.stringfiedComponents = {}
45
45
  self.undefinedStringifiedComponents = {}
46
46
  self.replicatedStringifiedComponents = {}
47
47
  self.predictedStringifiedComponents = {}
@@ -474,17 +474,19 @@ do
474
474
  if not self:worldContains(entity) then
475
475
  return nil
476
476
  end
477
- local _exp = self.components
478
- -- ▼ ReadonlyArray.forEach ▼
479
- local _callback = function(c)
477
+ local _exp = self.stringfiedComponents
478
+ -- ▼ ReadonlySet.forEach ▼
479
+ local _callback = function(cString)
480
+ local c = tonumber(cString)
480
481
  if self:worldHas(c) then
482
+ local lastState = self:worldGet(entity, c)
481
483
  local _stringifiedComponentSubscribers = self.stringifiedComponentSubscribers
482
484
  local _arg0 = tostring(c)
483
485
  local _result = _stringifiedComponentSubscribers[_arg0]
484
486
  if _result ~= nil then
485
487
  -- ▼ ReadonlySet.forEach ▼
486
488
  local _callback_1 = function(subscriber)
487
- subscriber(entity, nil, self:worldGet(entity, c))
489
+ subscriber(entity, nil, lastState)
488
490
  end
489
491
  for _v in _result do
490
492
  _callback_1(_v, _v, _result)
@@ -493,10 +495,10 @@ do
493
495
  end
494
496
  end
495
497
  end
496
- for _k, _v in _exp do
497
- _callback(_v, _k - 1, _exp)
498
+ for _v in _exp do
499
+ _callback(_v, _v, _exp)
498
500
  end
499
- -- ▲ ReadonlyArray.forEach ▲
501
+ -- ▲ ReadonlySet.forEach ▲
500
502
  self._world:delete(entity)
501
503
  if RunService:IsServer() then
502
504
  local _worldChangesForReplication = self.worldChangesForReplication
@@ -510,8 +512,9 @@ do
510
512
  local _undefinedStringifiedComponents = self.undefinedStringifiedComponents
511
513
  local _arg0 = tostring(c)
512
514
  _undefinedStringifiedComponents[_arg0] = true
513
- local _exp = self.components
514
- table.insert(_exp, c)
515
+ local _stringfiedComponents = self.stringfiedComponents
516
+ local _arg0_1 = tostring(c)
517
+ _stringfiedComponents[_arg0_1] = true
515
518
  if RunService:IsStudio() and self.logging then
516
519
  print(`{(debug.info(2, "sl"))}:{c}`)
517
520
  end