Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

TokenAction.newTurn throws "TypeError: Cannot read properties of undefined" #2074

Closed
mjeffw opened this issue Dec 28, 2024 · 1 comment · Fixed by #2088
Closed

TokenAction.newTurn throws "TypeError: Cannot read properties of undefined" #2074

mjeffw opened this issue Dec 28, 2024 · 1 comment · Fixed by #2088
Assignees
Labels
bug Something isn't working

Comments

@mjeffw
Copy link
Collaborator

mjeffw commented Dec 28, 2024

To recreate this bug:

Select three tokens on a map.
Right-click and Toggle Combat State.
Open Combat Tracker and roll initiative for all combatants.
Begin Combat.
Click the Next Turn arrow until you reach the last token.
Click Next turn -- error occurs.

The error is thrown on line 610:

    // Check for Effects marked for this turn
    const effects = this.lastManeuvers[Math.max(round - 1, 0)].nextTurnEffects || []
    for (const effect of effects) {
      await this.token.setEffectActive(effect, true)
    }

At this point, the "lastManeuvers" collection looks like this:
image

The other combatant's lastManeuver looks like this:
image

@mjeffw mjeffw added the bug Something isn't working label Dec 28, 2024
@mjeffw
Copy link
Collaborator Author

mjeffw commented Dec 28, 2024

If it matters, I have the following system settings:

  • Use Foundry Items = false.
  • Show Confirmation Dialog = False
  • Allow Roll based on Maneuver, Check for Targets before Roll, Allow Action after Max Actions = "warn"

@mjeffw mjeffw linked a pull request Dec 31, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants