fixed boundarie issues that only happen when alone

This commit is contained in:
jenz 2024-09-19 18:59:28 +02:00
parent ccb87ec738
commit 9158cb6f32

View File

@ -363,12 +363,12 @@ void AttemptRTV(int client)
g_VotesNeeded = Votes;
}
int rtv_percentage_reached = RoundToFloor((float(Votes) / float(g_VotesNeeded)) * 100);
if (rtv_percentage_reached > 100)
if (rtv_percentage_reached > 100 || rtv_percentage_reached < 0)
{
rtv_percentage_reached = 100;
}
int clients_percentage = RoundToFloor((GetPlayerWorthRTV_(client) / float(g_VotesNeeded)) * 100);
if (clients_percentage > 100)
if (clients_percentage > 100 || clients_percentage < 0)
{
clients_percentage = 100;
}