zayKenyon / VALORANT-rank-yoinker

A Python app which retrieves the VALORANT rank and players' equipped skins during a match
https://zayKenyon.github.io/VALORANT-rank-yoinker/
ISC License
433 stars 134 forks source link

Fix headshot % crash #103

Closed Ashesh3 closed 1 year ago

Ashesh3 commented 1 year ago

When total_hits is 0, this results in DivisionByZero Exception since we are dividing by 0 here to calculate head shot %. This PR adds a check for that and handles it.

[2022.08.08-13.35.40] Traceback (most recent call last):
File "\src\player_stats.py"

    hs = int((total_headshots/total_hits)*100)
ZeroDivisionError: division by zero
OwOHamper commented 1 year ago

I mean sure... if someone manages to get 0 hits in comp game :D

Ashesh3 commented 1 year ago

I mean sure... if someone manages to get 0 hits in comp game :D

Guess I got a noob in my lobby today then xD

Edit: Or maybe they disconnected for the whole match ¯\_(ツ)