Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: improved APM calculation accuracy
* Improved APM calculation accuracy The existing APM calculation is basically (actions / minutesPlayed) and minutesPlayed does not round at all, so if a game is 5m01s long, APM is calculated based on a game length of exactly 6 minutes. That causes minor inaccuracies which depend on the exact length of the game. There's a larger inaccuracy, too - in a team game, if a player leaves but the game continues, the parser will continue adding 0s to the 'timed' list for each minute, so the leaver's APM is calculated not based on their ingame time but the total length of the replay. It looks like currentTimePlayed is susceptible to inaccuracy via an AFKing player, but it seems like an acceptable compromise that the starting when a player begins AFKing through the end of the replay are not counted toward their calculated APM. * Using the correct equality * Test case for APM calc on an early leaver * Refined team leave test cases * Lint fix
- Loading branch information