OhhLoz / Harvester

A QoL FoundryVTT module to improve the harvesting and looting experience.
GNU General Public License v3.0
2 stars 2 forks source link

bug - multiple effects given on one harvest action #3

Closed OhhLoz closed 1 year ago

OhhLoz commented 1 year ago

This occurred in a game hosted by a friend, when another user harvested it gave the effect even after it was present on the target. I haven't been able to reproduce it myself

justinthejaguar commented 1 year ago

I am experiencing this as well.

OhhLoz commented 1 year ago

I am experiencing this as well.

What version are you running? I've updated quite a lot recently.

I can only imagine multiple users are running the executeAsGM() to add the effect to the token and bypassing the validation checks however that shouldn't be possible because as far as I'm aware only the person using an item calls the useItem hook.

I can try adding some extra checks but without a way to reproduce it on my end its hard to test if it works. Do you know how to reproduce it?

justinthejaguar commented 1 year ago

I am running your latest version last night. To be fair, I’m running a lot of automation modules m, so it’s possible that DAE, MIDI-QOL, or Convenient Effects are reapplying it. I show two effects when I update for loot or harvest. One is a 6 second effect and the other is unlimited. I will grab screenshots and errors (if they’re are any) after work today.

OhhLoz commented 1 year ago

it’s possible that DAE, MIDI-QOL, or Convenient Effects are reapplying it.

That's possible, the game that my friend was running had Midi-QOL, and the way I was applying effects in previous versions was a temporary effect attached to the action so maybe MidiQOL is using that to automatically apply it aswell as the code in my module that applies it.

I left that temporary effect attached incase it was needed however if its causing errors it can be removed.

I still can't reproduce the issue with MidiQOL. Presumably, its to do with the "Automatically apply item effects" in the workflow tab.

OhhLoz commented 1 year ago

Hopefully this should be fixed in versions 1.5.1 for Foundry v11 and 1.3.6 for Foundry v10.

The temporary effect included in the compendium was set to 1 round duration (aka 6 seconds) so it can be safely assumed it was automatically being added by MidiQOL or similar automation.

The problem with this fix is that it won't change already assigned actions on actors, so the effects will still be on the Harvest/Loot actions already present on Actors and will need removing manually.

I'll close this issue for now as I believe its resolved, thank you for your help @justinthejaguar