drekdrek / grinding-stats

Openplanet plugin which shows statistics
https://openplanet.dev/plugin/grindingstats
MIT License
6 stars 5 forks source link

Standing respawn increments number of respawns by two #39

Open henrysallandt opened 2 months ago

henrysallandt commented 2 months ago

A flying respawn increments the number of respawns by one (intended behavior). A standing respawn (press two times respawn button in quick succession) increments the number of respawns by two.

Could be fixed in a relatively stupid way (did not find a better method :D) using Time::get_Now().

  1. initialise a variable with Time::get_Now() (when plugin is loaded)
  2. When respawn is requested, check if Time::get_Now() - variable is lower than 1000 (--> 1sec) and only treat as another respawn is it is higher than that
  3. set variable again to Time::get_Now()
drekdrek commented 2 months ago

this is just because you can initiate a standing respawn. the double press of the respawn key or a single press of the standing respawn keybind (unbound by default)

i'll look into any better methods for this

drekdrek commented 2 months ago

https://github.com/drekdrek/grinding-stats/assets/35672537/c7c77591-60d0-4e1d-a87a-944ba3a8d5d0

i got something working