Skip to content

Commit 47473b4

Browse files
committed
Make c_unrtv share a cooldown with c_rtv
- People like to troll rtv then insta unrtv, so this stops that - Also print vote counts in unrtv commands, so players can check current rtv count without the need to rtv themselves or have someone else newly rtv.
1 parent 034e649 commit 47473b4

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/votemanager.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ CON_COMMAND_CHAT(rtv, "- Vote to end the current map sooner")
233233
if (pPlayer->GetRTVVoteTime() + 60.0f > GetGlobals()->curtime)
234234
{
235235
int iRemainingTime = (int)(pPlayer->GetRTVVoteTime() + 60.0f - GetGlobals()->curtime);
236-
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "Wait %i seconds before you can RTV again.", iRemainingTime);
236+
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "Wait %i seconds before you can RTV.", iRemainingTime);
237237
return;
238238
}
239239

@@ -268,12 +268,21 @@ CON_COMMAND_CHAT(unrtv, "- Remove your vote to end the current map sooner")
268268

269269
if (!pPlayer->GetRTVVote())
270270
{
271-
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "You have not voted to RTV current map.");
271+
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "You have not voted to RTV current map (%i voted, %i needed).", g_pVoteManager->GetCurrentRTVCount(), g_pVoteManager->GetNeededRTVCount());
272+
return;
273+
}
274+
275+
if (pPlayer->GetRTVVoteTime() + 60.0f > GetGlobals()->curtime)
276+
{
277+
int iRemainingTime = (int)(pPlayer->GetRTVVoteTime() + 60.0f - GetGlobals()->curtime);
278+
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "Wait %i seconds before you can remove your RTV.", iRemainingTime);
272279
return;
273280
}
274281

275282
pPlayer->SetRTVVote(false);
276-
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "You no longer want to RTV current map.");
283+
pPlayer->SetRTVVoteTime(GetGlobals()->curtime);
284+
285+
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "You no longer want to RTV current map (%i voted, %i needed).", g_pVoteManager->GetCurrentRTVCount(), g_pVoteManager->GetNeededRTVCount());
277286
}
278287

279288
CON_COMMAND_CHAT(ve, "- Vote to extend current map")

0 commit comments

Comments
 (0)