Merge pull request #860 from nullworks/totallynotelite
Fix bots getting stuck while respawning
This commit is contained in:
commit
6051bb0e40
@ -741,7 +741,8 @@ static void cm()
|
||||
reportall();
|
||||
}
|
||||
|
||||
static Timer autojointeam{};
|
||||
static Timer unstuck{};
|
||||
static int unstucks;
|
||||
static Timer report_timer2{};
|
||||
void update()
|
||||
{
|
||||
@ -775,9 +776,19 @@ void update()
|
||||
return;
|
||||
|
||||
if (LOCAL_E->m_bAlivePlayer())
|
||||
autojointeam.update();
|
||||
if (autojointeam.test_and_set(60000) && !LOCAL_E->m_bAlivePlayer())
|
||||
hack::command_stack().push("autoteam; join_class sniper");
|
||||
{
|
||||
unstuck.update();
|
||||
unstucks = 0;
|
||||
}
|
||||
if (unstuck.test_and_set(10000))
|
||||
{
|
||||
unstucks++;
|
||||
// Send menuclosed to tell the server that we want to respawn
|
||||
hack::command_stack().push("menuclosed");
|
||||
// If that didnt work, force pick a team and class
|
||||
if (unstucks > 3)
|
||||
hack::command_stack().push("autoteam; join_class sniper");
|
||||
}
|
||||
|
||||
if (micspam)
|
||||
{
|
||||
|
@ -36,18 +36,18 @@ CatCommand join("mm_join", "Join mm Match", []() {
|
||||
bool replaced = false;
|
||||
namespace hooked_methods
|
||||
{
|
||||
DEFINE_HOOKED_METHOD(PaintTraverse, void, vgui::IPanel *this_, unsigned int panel, bool force, bool allow_force)
|
||||
DEFINE_HOOKED_METHOD(PaintTraverse, void, vgui::IPanel *this_, vgui::VPANEL panel, bool force, bool allow_force)
|
||||
{
|
||||
if (!isHackActive())
|
||||
return original::PaintTraverse(this_, panel, force, allow_force);
|
||||
|
||||
static bool textures_loaded = false;
|
||||
static unsigned long panel_scope = 0;
|
||||
static unsigned long FocusOverlayPanel = 0;
|
||||
static unsigned long motd_panel = 0;
|
||||
static unsigned long motd_panel_sd = 0;
|
||||
static unsigned long health_panel = 0;
|
||||
static bool call_default = true;
|
||||
static bool textures_loaded = false;
|
||||
static vgui::VPANEL panel_scope = 0;
|
||||
static vgui::VPANEL FocusOverlayPanel = 0;
|
||||
static vgui::VPANEL motd_panel = 0;
|
||||
static vgui::VPANEL motd_panel_sd = 0;
|
||||
static vgui::VPANEL health_panel = 0;
|
||||
static bool call_default = true;
|
||||
static bool cur;
|
||||
static ConVar *software_cursor = g_ICvar->FindVar("cl_software_cursor");
|
||||
static const char *name;
|
||||
|
Reference in New Issue
Block a user