@rbxts/covenant 3.2.2 → 3.2.4

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.2",
3
+ "version": "3.2.4",
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,10 +474,11 @@ 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)
480
- if self:worldHas(c) then
477
+ local _exp = self.stringfiedComponents
478
+ -- ▼ ReadonlySet.forEach ▼
479
+ local _callback = function(cString)
480
+ local c = tonumber(cString)
481
+ if self:worldHas(entity, c) then
481
482
  local lastState = self:worldGet(entity, c)
482
483
  local _stringifiedComponentSubscribers = self.stringifiedComponentSubscribers
483
484
  local _arg0 = tostring(c)
@@ -494,10 +495,10 @@ do
494
495
  end
495
496
  end
496
497
  end
497
- for _k, _v in _exp do
498
- _callback(_v, _k - 1, _exp)
498
+ for _v in _exp do
499
+ _callback(_v, _v, _exp)
499
500
  end
500
- -- ▲ ReadonlyArray.forEach ▲
501
+ -- ▲ ReadonlySet.forEach ▲
501
502
  self._world:delete(entity)
502
503
  if RunService:IsServer() then
503
504
  local _worldChangesForReplication = self.worldChangesForReplication
@@ -511,8 +512,9 @@ do
511
512
  local _undefinedStringifiedComponents = self.undefinedStringifiedComponents
512
513
  local _arg0 = tostring(c)
513
514
  _undefinedStringifiedComponents[_arg0] = true
514
- local _exp = self.components
515
- table.insert(_exp, c)
515
+ local _stringfiedComponents = self.stringfiedComponents
516
+ local _arg0_1 = tostring(c)
517
+ _stringfiedComponents[_arg0_1] = true
516
518
  if RunService:IsStudio() and self.logging then
517
519
  print(`{(debug.info(2, "sl"))}:{c}`)
518
520
  end