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:
trotFunky 2025-06-10 22:49:42 +01:00
parent f6437d7884
commit 3914c979b2

View file

@ -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.