From 418fad6282189060aa64ff93c5435dc4a34cea0d Mon Sep 17 00:00:00 2001 From: ".kkrill" <70514395+kirillbrest123@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:16:24 +0300 Subject: [PATCH 1/2] Update rtv.lua --- lua/mapvote/server/modules/rtv.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/mapvote/server/modules/rtv.lua b/lua/mapvote/server/modules/rtv.lua index 17842a8..6dd6cd8 100644 --- a/lua/mapvote/server/modules/rtv.lua +++ b/lua/mapvote/server/modules/rtv.lua @@ -69,7 +69,7 @@ function RTV.ShouldChange() if totalPlayers == 0 then return end - return totalVotes >= math.Round( totalPlayers * conf.RTVPercentPlayersRequired ) + return totalVotes >= math.ceil( totalPlayers * conf.RTVPercentPlayersRequired ) end function RTV.StartIfShouldChange() @@ -99,7 +99,7 @@ function RTV.AddVote( ply ) timer.Simple( 0, function() if not ply:IsValid() then return end MsgN( ply:Nick() .. " has voted to change the map." ) - local percentage = math.Round( RTV.GetPlayerCount() * conf.RTVPercentPlayersRequired ) + local percentage = math.ceil( RTV.GetPlayerCount() * conf.RTVPercentPlayersRequired ) PrintMessage( HUD_PRINTTALK, ply:Nick() .. " has voted to change the map. (" .. RTV.GetVoteCount() .. "/" .. percentage .. ")" ) end ) @@ -127,7 +127,7 @@ function RTV.CanVote( ply ) if ply.RTVVoted then return false, string.format( "You have already voted to change the map! (%s/%s)", RTV.GetVoteCount(), - math.Round( RTV.GetPlayerCount() * conf.RTVPercentPlayersRequired ) ) + math.ceil( RTV.GetPlayerCount() * conf.RTVPercentPlayersRequired ) ) end if MapVote.state.isInProgress then From 48862d698fb5bd3f2ab3044e8453323194b7fb33 Mon Sep 17 00:00:00 2001 From: ".kkrill" <70514395+kirillbrest123@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:18:02 +0300 Subject: [PATCH 2/2] Update map_vote.lua --- lua/mapvote/client/modules/map_vote.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/mapvote/client/modules/map_vote.lua b/lua/mapvote/client/modules/map_vote.lua index 0f54179..aed0a0b 100644 --- a/lua/mapvote/client/modules/map_vote.lua +++ b/lua/mapvote/client/modules/map_vote.lua @@ -72,7 +72,7 @@ function MapVote.StartVote( maps, endTime ) timer.Remove( "MapVoteCountdown" ) return end - local timeLeft = math.Round( math.Clamp( endTime - CurTime(), 0, math.huge ) ) + local timeLeft = math.ceil( math.Clamp( endTime - CurTime(), 0, math.huge ) ) countdownLabel:SetText( string.FormattedTime( timeLeft or 0, "%02i:%02i" ) ) end )