Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[BUG] SWADE new round bug fix #57

Merged
merged 2 commits into from
May 24, 2021
Merged

[BUG] SWADE new round bug fix #57

merged 2 commits into from
May 24, 2021

Conversation

kckaiwei
Copy link
Owner

@kckaiwei kckaiwei commented May 1, 2021

This fixes:
#45

Some refactoring was done on the function handling combat updates as well.

Usage:

No real changes, will properly update when a new combat round is done in SWADE. Note that there may be a short moment where the marker jumps to the correct new actor. It's a limitation and not fixable with my current knowledge/additions to the SWADE system

Tech notes:

While SWADE does emit a socket signal:

game.socket.emit('system.swade', { type: 'newRound', combatId: this.id });

I'm having difficulty picking it up with a Hooks.once('ready' for some reason. I'm not sure whether there's no cross module support in foundry or if I'm doing something wrong, but the lack of foundryvtt documentation hasn't cleared it up for me.

There's also no hook fired when a new round is created (the function that SWADE overrides to reshuffle initiative), with that said, I've had to resort to hooking into the renderCombatTracker hook, which would get fired after each turn update + each round update. It's not the most ideal solution, considering how there are multiple emits for that hook, but its the best that can be done without a proper hook, and no access to the socket.

The logic checks for the SWADE system specifically, so normal functionality won't be affected.

@kckaiwei kckaiwei added the bug Something isn't working label May 1, 2021
@kckaiwei kckaiwei changed the title [BUG] Swade bug fix [BUG] SWADE new round bug fix May 1, 2021
@kckaiwei kckaiwei self-assigned this May 1, 2021
@kckaiwei kckaiwei merged commit 98e089a into main May 24, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant