PGM icon indicating copy to clipboard operation
PGM copied to clipboard

Custom projectile cooldown not respected after switching teams

Open willocn opened this issue 1 year ago • 1 comments

When you switch teams during a match, projectile cooldown is not respected. Projectile works as expected if you switch back to the original team.

Steps to reproduce

  1. Join a team
  2. Switch teams
  3. Observe that you can shoot projectiles instantly

This doesn't happen on FFA matches.

https://github.com/PGMDev/PGM/assets/88864994/d41b93c5-18de-49a6-a90e-b23c4a66b5a8

willocn avatar Dec 17 '23 23:12 willocn

Caused by the following code which always sets the cooldown to be ended if the player team states don't match. https://github.com/PGMDev/PGM/blob/12e9e602e3b7b3064d8a302719f5f5d5d4885ab7/core/src/main/java/tc/oc/pgm/projectile/CooldownRunnable.java#L24

Looks like cooldowns are stored for a player on each team they join but due to equal checks they always use the expired one.

Pugzy avatar Dec 17 '23 23:12 Pugzy

Fixed in #1297

Pablete1234 avatar Apr 27 '24 16:04 Pablete1234