Better vote timer (#1754)

* Better vote timer

* autism

* Update votelogger.cpp
This commit is contained in:
nullptrmachine 2022-12-27 17:54:14 +01:00 committed by GitHub
parent d63edfdf0e
commit dd51504a76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,9 +71,18 @@ void dispatchUserMessage(bf_read &buffer, int type)
switch (type)
{
case 45:
{
// Vote setup Failed, Refresh vote timer for catbot so it can try again
hacks::shared::catbot::timer_votekicks.last -= std::chrono::seconds(4);
int reason = buffer.ReadByte();
int cooldown = buffer.ReadShort();
int delay = 4;
if ( reason == 2 ) // VOTE_FAILED_RATE_EXCEEDED
delay = cooldown;
hacks::shared::catbot::timer_votekicks.last -= std::chrono::seconds(delay);
break;
}
case 46:
{
// TODO: Add always vote no/vote no on friends. Cvar is "vote option2"