CarlosFdez / pf2e-persistent-damage

Keeps track of persistent damage on actors for PF2E for Foundry VTT
5 stars 4 forks source link

0.8.6 Rolls Persistent effects twice. #12

Closed Cosmic-Lattee closed 3 years ago

Cosmic-Lattee commented 3 years ago

Everything still seems to work with the new version however whenever the end of a turn comes for a monster it does the persistent effect twice (see picture below).

image

CarlosFdez commented 3 years ago

Are you using a calendar module? There's apparently one that causes this interaction (I believe it causes the update turn to fire multiple times).

Cosmic-Lattee commented 3 years ago

I am indeed that is a interesting interaction. When I was testing I was turning off PF2E modules, I didn't even think about turning the calendar off lol.

Sorry about that. It is indeed the Calendar/Weather (https://foundryvtt.com/packages/calendar-weather) that is causing this doubling.

Edit: Also interestingly enough I just reloaded my game after testing that turning the Calendar/Weather module back on, and it seems to be working normally now? Odd. <.<

Edit Edit (lol): I am going to do some more testing. Getting some inconsistent results where it works sometimes and not others.

CarlosFdez commented 3 years ago

This is definitely odd. Someone in the discord had the issue without the calendar/weather mod apparently. Requires some investigating, but its likely a core pf2e error we're just not aware of what the causes are.

DoggieBert commented 3 years ago

I am seeing this same issue and I can add some more detail. At the end of a tokens turn persistent damage is being rolled by each logged in player, so in my case I was getting 6 damage rolls (GM + 5 players). I'm fairly confident it's each player rolling it because the dice rolled match each of my players' configured dice in dice so nice. I do have Calendar/Weather running, but I tried disabling it and saw the same issue, so that doesn't seem to be the culprit.

Cosmic-Lattee commented 3 years ago

Ah that would be why I was only seeing 2 rolls. I was just playing a game with one player (so GM + Player). That is why I was getting a inconsistent result yesterday Carlos. There were times I just testing it by myself, and other times the other player was in the game.

However I don't have Dice so Nice. With all mods but Persistent damage off I can reproduce it. One player (just me) is one roll, when I get the second player then it is two rolls.

CarlosFdez commented 3 years ago

That explains it. Got to reproduce it. I have no idea why this changed in 0.8 specifically, but it seems like in that version the end turn is called for all players. This is definitely more helpful, though unfortunately might have a tricky solution. I'll think on it.

DoggieBert commented 3 years ago

I agree, it looks like pf2e.startTurn/endTurn hooks are running for every player. I added 'game.user.isGM' to the if statements under the hooks which works for my games, but would still roll multiple times for anyone with multiple GMs logged in.

CarlosFdez commented 3 years ago

Yup. I fixed it locally for persistent damage even if multiple GMs are logged in (whoever progressed combat performs the roll), but for start turn it will still have that multiple GM issue. I plan to fix it later but I'm busy today and would prefer to fix it for 99% of people if I can.

CarlosFdez commented 3 years ago

For all intents and purposes its fixed now, I'll look into the multi gm issue at a later date.