PGM
PGM copied to clipboard
Custom projectile cooldown not respected after switching teams
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
- Join a team
- Switch teams
- 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
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.
Fixed in #1297