Borders: don't check turns when combat has not started
When trying to figure out if a token has played or not, we might get an active combat which hasn't started. In this case the Fabula Ultima flags do not exist yet, and trying to access them will error. Check that the combat we found has indeed been started, otherwise there's no way a token can have played and we don't need to check.
This commit is contained in:
parent
f6437d7884
commit
3914c979b2
1 changed files with 4 additions and 0 deletions
|
@ -161,6 +161,10 @@ function token_has_played(token, round = -1) {
|
|||
}
|
||||
}
|
||||
|
||||
// The token can't have played if the combat hasn't started yet.
|
||||
if (!combat.started)
|
||||
return false;
|
||||
|
||||
let round_turns_taken = combat?.flags.projectfu.CombatantsTurnTaken[round < 0 ? combat?.round : round]
|
||||
|
||||
// No token has taken a turn, or all turns were reverted.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue