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

Fix projectile cooldowns when switching teams #1297

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

Pugzy
Copy link
Contributor

@Pugzy Pugzy commented Feb 7, 2024

Started out as a fix for #1285 where switching teams would result in items bypassing their cooldowns.

Ended up refactoring the whole runner and cooldown logic:

  • Store all of a player cooldown sin single ProjectileCooldowns class.
  • Store all player cooldowns in a player UUID keyed hashmap.
  • Tick player cooldowns collectively and only update visuals for item in hand (reduces multiple inventory iterations and checks).
  • Add slight increase to item name visual cooldown duration.
  • Stop items that have cooldowns sub 200ms from having their name changed.
  • Reset player cooldowns on participation end (leave or team switch).

@Pugzy Pugzy requested a review from Electroid as a code owner February 7, 2024 17:10
@Pablete1234 Pablete1234 added the ready PR is ready to merge label Feb 19, 2024
@Electroid Electroid merged commit ef5d5a9 into PGMDev:dev Feb 20, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready PR is ready to merge
Development

Successfully merging this pull request may close these issues.

3 participants