From 300005631885ad20053d5442f6975f368c6cba03 Mon Sep 17 00:00:00 2001 From: MasterCatPL Date: Sun, 14 Apr 2024 00:19:31 +0200 Subject: [PATCH] Updated votelogger and Autojoin made votelogger delay 0 AutoJoin is now faster than 5 seconds --- src/hacks/AutoJoin.cpp | 5 +++-- src/votelogger.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/hacks/AutoJoin.cpp b/src/hacks/AutoJoin.cpp index d1d5b525..753cc520 100644 --- a/src/hacks/AutoJoin.cpp +++ b/src/hacks/AutoJoin.cpp @@ -37,7 +37,6 @@ bool UnassignedClass() return g_pLocalPlayer->clazz != *autojoin_class; } -static Timer autoteam_timer{}; static Timer startqueue_timer{}; #if not ENABLE_VISUALS Timer queue_time{}; @@ -101,6 +100,7 @@ void updateSearch() tfmm::startQueue(); } } + startqueue_timer.test_and_set(5000); #if not ENABLE_VISUALS if (queue_time.test_and_set(1200000)) @@ -111,7 +111,8 @@ void updateSearch() } static void update() { - if (autoteam_timer.test_and_set(5000)) + static Timer autoteam_timer{}; + if (autoteam_timer.test_and_set(750)) { if (autojoin_team and UnassignedTeam()) { diff --git a/src/votelogger.cpp b/src/votelogger.cpp index 0c420dfd..f6b9b77d 100644 --- a/src/votelogger.cpp +++ b/src/votelogger.cpp @@ -122,14 +122,14 @@ void dispatchUserMessage(bf_read &buffer, int type) if (*vote_kickn && friendly_kicked) { - vote_command = { strfmt("vote %d option2", vote_id).get(), 1000u + (rand() % 5000) }; + vote_command = { strfmt("vote %d option2", vote_id).get(), 0 }; vote_command.timer.update(); if (*vote_rage_vote && !friendly_caller) pl_caller.state = k_EState::RAGE; } else if (*vote_kicky && !friendly_kicked) { - vote_command = { strfmt("vote %d option1", vote_id).get(), 1000u + (rand() % 5000) }; + vote_command = { strfmt("vote %d option1", vote_id).get(), 0 }; vote_command.timer.update(); } }