abnerfs / cs2-rockthevote

General purpose cs2 map voting plugin, made with love from scratch
87 stars 30 forks source link

!rtv goes through after only one vote with two players on the server when in the config 60% of players are required to vote. #38

Closed alnoisegit closed 7 months ago

alnoisegit commented 7 months ago

With "VotePercentage": 60 in config and 2 players on the server, if one player does !rtv the vote still goes through. It should have to wait until both players do !rtv for the vote to go through. This might be accounting for a player who already did !rtv but then left the server, but I'm not sure.

abnerfs commented 7 months ago

The number of required votes is 0.6 2 = 1.2, rounded it becomes 1 so it is working as intended, we could change the rounding there but it would affect other scenarios, you could raise the percentage to 75 so you would have 0.75 2 = 1.5 which would be rounded to 2 (it case of 0.5 it rounds to the nearest even number)