jessev14 / pf2e-staves

MIT License
5 stars 9 forks source link

Debounce spellcasting entry creation #41

Closed esheyw closed 9 months ago

esheyw commented 10 months ago

Moving a staff between, for example, a loot actor and a PC, fires both the createItem and updateItem hooks in too-quick succession, and the module creates two spellcasting entries. Simply debouncing the creation function by 100ms was enough to solve the issue on my locally hosted instance, it might need to be increased for cases with actual network latency.