@rpgjs/common 5.0.0-alpha.36 → 5.0.0-alpha.38

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/dist/index.js CHANGED
@@ -10854,7 +10854,30 @@ class RpgCommonMap {
10854
10854
  const eventsMap = this.events();
10855
10855
  const isSelfPlayer = !!playersMap[self.uuid];
10856
10856
  const isOtherPlayer = !!playersMap[other.uuid];
10857
+ const isSelfEvent = !!eventsMap[self.uuid];
10857
10858
  const isOtherEvent = !!eventsMap[other.uuid];
10859
+ const readScenarioOwnerId = (owner2) => {
10860
+ const scenarioOwnerId = owner2?._scenarioOwnerId ?? owner2?.scenarioOwnerId;
10861
+ return typeof scenarioOwnerId === "string" && scenarioOwnerId.length > 0 ? scenarioOwnerId : void 0;
10862
+ };
10863
+ const selfScenarioOwnerId = readScenarioOwnerId(selfOwner);
10864
+ const otherScenarioOwnerId = readScenarioOwnerId(otherOwner);
10865
+ if (selfScenarioOwnerId) {
10866
+ if (isOtherPlayer && other.uuid !== selfScenarioOwnerId) {
10867
+ return false;
10868
+ }
10869
+ if (isOtherEvent && otherScenarioOwnerId !== selfScenarioOwnerId) {
10870
+ return false;
10871
+ }
10872
+ }
10873
+ if (otherScenarioOwnerId) {
10874
+ if (isSelfPlayer && self.uuid !== otherScenarioOwnerId) {
10875
+ return false;
10876
+ }
10877
+ if (isSelfEvent && selfScenarioOwnerId !== otherScenarioOwnerId) {
10878
+ return false;
10879
+ }
10880
+ }
10858
10881
  if (isSelfPlayer && isOtherPlayer) {
10859
10882
  if (typeof selfOwner._throughOtherPlayer === "function") {
10860
10883
  try {