Autmor / yourTurn

Foundry Module that adds a visual display whenever the turn changes.
6 stars 15 forks source link

Weird behavior with systems that don't have an active character on "Next Round" press #22

Open MNielson opened 1 year ago

MNielson commented 1 year ago

An error is thrown when Next Round is clicked, while there is no active character. This might be the case in certain systems.

When using this module in a system like Exalted Essence, initiative is very flexible. In Exalted Essence you can click a button next to the character in the initiative tracker to set them as the active character. When Next Round is clicked, Exalted Essence clears the active character as no character can be assumed to act first in the next round in the system.

This causes an error on line 40 of yourTurn.js, as actor is undefined.

This, probably, causes unintended behaviour later. The character with the higest initiative value doesn't get "announced" by YourTurn when his turn is set to active. Probably because YourTurn assumes that characters turn already got announced when the next round triggered or because the error on line 40 earlier caused some problems.

All other characters are announced correctly by YourTurn when set to active in Exalted Essence.