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

firstGm is not Defined #131

Open
galaara98 opened this issue Jan 2, 2022 · 2 comments
Open

firstGm is not Defined #131

galaara98 opened this issue Jan 2, 2022 · 2 comments

Comments

@galaara98
Copy link

galaara98 commented Jan 2, 2022

an error in the console appears when GM advances the turn to the next participant in the combat tracker.
the error looks like this:

Uncaught (in promise) ReferenceError: firstGm is not defined
[Detected 2 packages: Next-Up, system:pf2e]
at handleCombatUpdate (nextUp.js:349)
at Function._call (foundry.js:294)
at Function.callAll (foundry.js:253)
at ClientDatabaseBackend.callback (foundry.js:10216)
at foundry.js:10155
at Array.map ()
at ClientDatabaseBackend._handleUpdateDocuments (foundry.js:10155)
at ClientDatabaseBackend._updateDocuments (foundry.js:10036)
at async Function.updateDocuments (document.mjs:373)
at async EncounterPF2e.update (document.mjs:456)
at async EncounterPF2e.nextTurn (main.bundle.js:1)
at async EncounterTrackerPF2e._onCombatControl (foundry.js:58273)
at async EncounterTrackerPF2e._onCombatControl (main.bundle.js:1)

To Reproduce
(Some step might not be required, I have a game soon and so did not strip it down to minimal mods, least number of variables... I am genuinely sorry)

Steps to reproduce the behavior:
prepare a combat with at least one actor that is an NPC and one that is a PC
open js console in the browser to see real-time logging
start the encounter
progress the encounter turn, each time the encounter moves to the next participant the error is logged
*as far as I can tell at this time it is not hurting MY particular game (it is always possible I do not know what is or isnt working and it is, but I didn't need it personally)

Expected behavior
Currenly All I am expecting is to not have an error when the encounter tracker progresses to the next participant

Screenshots
If applicable, add screenshots to help explain your problem.

Environment:

  • OS: Client: Windows, Server Ubuntu, Node 16.3.1
  • Browser Chromium based Edge 96.0.1054.62
  • Foundry Version: Stable 9.238
  • System Version: PF2e 3.1.3.9639
  • Module Version: 0.1.14
  • All Modules Disabled: No
  • Module List if no:
    Next-Up
    adventuremusic
    angela-maps
    animated-maps
    baileywiki-maps
    betterroofs
    bossbar
    boy-king-of-idaho-music-pack
    caeora-maps-tokens-assets
    colorsettings
    combat-enhancements
    darkraven-games-soundscapes-free
    dd-import
    ddd-bloody-blueprints-and-macabre-maps
    dice-cheater-protector
    dice-so-nice
    dndAudioBundle-HammerHome
    drag-ruler
    dragonfiremaps
    dungeon-draw
    elven-tower-free-maps
    enhanced-terrain-layer
    foundry-drmapzo-free
    foundry_community_tables
    foundryvtt-simple-calendar
    fxmaster
    gAudioBundle-1
    gAudioBundle-2
    gAudioBundle-3
    gAudioBundle-4
    give-item
    ivan-duch-music-packs
    kandashis-fluid-canvas
    levels
    lib-changelogs
    lib-wrapper
    maestro
    mcromusic-sampler
    michaelghelfi
    mikwewa-free
    mikwewa-maps-free
    milbys-maps-free
    monks-active-tiles
    moonlight-maps-free
    music-d20-sampler
    npc-chatter
    pause-icon
    perfect-vision
    pf2e-dragruler
    pf2e-f-is-for-flatfooted
    pf2e-lootgen
    pf2e-modifiers-matter
    pf2e-persistent-damage
    pf2e-toolbox
    pf2qr
    pings
    popout
    popout-resizer
    quick-insert
    revealed-notes-manager
    rule-element-generator
    settings-extender
    smarttarget
    socketlib
    soundfxlibrary
    splatter
    tacticalmap-free
    terrain-ruler
    token-action-hud
    token-auras
    trigger-happy
    vtta-tokenizer
    wall-height
    weatherblock

Additional context
Add any other context about the problem here.

@galaara98 galaara98 changed the title [QUESTION] firstGm is not Defined Jan 2, 2022
@galaara98
Copy link
Author

i beleive the offending code is

NextUP.cycleSheets(nextToken, previousToken)
        if (playerPanEnable && playerPan && (nextToken.isVisible || game.user === firstGm)) {
            canvas.animatePan({ x: nextToken.center.x, y: nextToken.center.y, duration: 250 });
        }

and should be (I THINK this was your intention):

NextUP.cycleSheets(nextToken, previousToken)
        if (playerPanEnable && playerPan && (nextToken.isVisible || game.user === isGM)) {
            canvas.animatePan({ x: nextToken.center.x, y: nextToken.center.y, duration: 250 });
        }

@galaara98
Copy link
Author

galaara98 commented Jan 3, 2022

hmm i went back through your past code, you were definitely using firstGm in the past... and noone was complaining, so that property must have existed... so my solution might not be correct,

I looked at my own game as it was running as a GM, and my game.user does not have a firstGm property, so I just don't know what the original purpose was???

:( I wish I could be more help!
I am going to leave my game running with the above proposed solution, which causes panning to next token if panning is "on" and player is "GM"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant