Auto class, auto team
This commit is contained in:
parent
7ce39de0c3
commit
27fe90b91f
@ -14,6 +14,8 @@ namespace shared
|
||||
namespace autojoin
|
||||
{
|
||||
|
||||
extern CatVar auto_queue;
|
||||
|
||||
void Update();
|
||||
void UpdateSearch();
|
||||
}
|
||||
|
@ -62,11 +62,11 @@ void UpdateSearch()
|
||||
}
|
||||
}
|
||||
|
||||
Timer timer{};
|
||||
|
||||
void Update()
|
||||
{
|
||||
static Timer timer;
|
||||
|
||||
if (timer.test_and_set(500))
|
||||
if (timer.test_and_set(500))
|
||||
{
|
||||
if (autojoin_team and UnassignedTeam())
|
||||
{
|
||||
|
@ -848,15 +848,13 @@ index_t SelectNextNode()
|
||||
|
||||
bool free_move_used = false;
|
||||
|
||||
Timer slot_timer{};
|
||||
|
||||
void UpdateSlot()
|
||||
{
|
||||
static auto last_check = std::chrono::system_clock::now();
|
||||
auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::system_clock::now() - last_check)
|
||||
.count();
|
||||
|
||||
if (CE_GOOD(LOCAL_E) && CE_GOOD(LOCAL_W) && !g_pLocalPlayer->life_state &&
|
||||
ms > 1000)
|
||||
if (!slot_timer.test_and_set(1000))
|
||||
return;
|
||||
if (CE_GOOD(LOCAL_E) && CE_GOOD(LOCAL_W) && !g_pLocalPlayer->life_state)
|
||||
{
|
||||
IClientEntity *weapon = RAW_ENT(LOCAL_W);
|
||||
// IsBaseCombatWeapon()
|
||||
@ -869,8 +867,6 @@ void UpdateSlot()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
last_check = std::chrono::system_clock::now();
|
||||
}
|
||||
|
||||
void UpdateWalker()
|
||||
|
@ -242,7 +242,7 @@ bool CreateMove_hook(void *thisptr, float inputSample, CUserCmd *cmd)
|
||||
}
|
||||
g_Settings.bInvalid = false;
|
||||
|
||||
// hacks::shared::autojoin::Update();
|
||||
hacks::shared::autojoin::Update();
|
||||
|
||||
#if ENABLE_IPC == 1
|
||||
static int team_joining_state = 0;
|
||||
|
@ -406,6 +406,9 @@ void Shutdown_hook(void *_this, const char *reason)
|
||||
{
|
||||
original(_this, reason);
|
||||
}
|
||||
|
||||
if (hacks::shared::autojoin::auto_queue)
|
||||
tfmm::abandon();
|
||||
}
|
||||
|
||||
static CatVar resolver(CV_SWITCH, "resolver", "0", "Resolve angles");
|
||||
|
Reference in New Issue
Block a user