p4535992 / conditional-visibility

a FoundryVTT module to hide tokens from some players, but not from others
MIT License
5 stars 8 forks source link

[BUG] 'Disable for Non-Hostile' disables Conditional Visability's hiding of tokens for all tokens #23

Closed Brimcon closed 2 years ago

Brimcon commented 2 years ago

Module Version: v0.5.15 Foundry Version: 9.255 DnD5e Version: 1.5.7

Describe the bug With Disable for non hostile npc enabled. Selecting a Hostile NPC (In this case, Acolyte from DnD5e) still shows the hidden/invisible token.

To Reproduce Steps to reproduce the behavior: With only Conditional Visibility and its dependencies enabled import from DnD5e three actors. Two "Starter Heroes" (Suggest Using the Dwarf Rogue for 'higher' rolls on stealth, the second hero does not matter) as well as a Monster (Acolyte is the easiest as it has a very low Passive Perception) Enable Disable for non hostile npc in Module Settings Enable Auto hide on stealth rolls to make the stealth check more convenient Roll a Stealth Check for one of the Heroes. (Again, Dwarf Rogue has a higher score) Click on the Hostile Token. Observe "Hidden" Actor still visible.

Expected behavior Hostile tokens unable to see the player token.

Screenshots image

image

Browser: Chrome

Additional context CVHostile Enabled.log

CVHostile Disabled.log

Edit: This error pops up on a Player Client when the Hostile token rolls for Stealth

libwrapper.js:646 Uncaught (in promise) Error: User Player4 lacks permission to update Token [sXXzZmRxigdBzDiW] in parent Scene [Nu75iPQRJrJ2YCoo]
[No packages detected]
    at ServerDatabaseBackend._updateEmbeddedDocuments (/home/foundry/resources/app/dist/database/backend/server-backend.mjs:1:3611)
    at async Semaphore._try (/home/foundry/resources/app/common/utils/semaphore.mjs:99:17)
p4535992 commented 2 years ago

Should be solved with 0.5.20, let me know

Brimcon commented 2 years ago

It is fixed! But this error still prints if an NPC or even another player rolls stealth with the auto stealth function enabled:

Uncaught (in promise) Error: User Player3 lacks permission to update Token [sXXzZmRxigdBzDiW] in parent Scene [Nu75iPQRJrJ2YCoo]
[No packages detected]
    at ServerDatabaseBackend._updateEmbeddedDocuments (/home/foundry/resources/app/dist/database/backend/server-backend.mjs:1:3611)
    at async Semaphore._try (/home/foundry/resources/app/common/utils/semaphore.mjs:99:17)

But that might need a different Issue Report and outside the scope of this one.