Merge pull request #660 from l0fg/l0fg-pr-cleanup
Cleanup: LAG_BOT ifdefs and CMake option
This commit is contained in:
commit
625316c88e
@ -25,7 +25,6 @@ set_property(CACHE Game PROPERTY STRINGS ${GameValues})
|
||||
|
||||
set(EnableProfiler 0 CACHE BOOL "Enable Profiler")
|
||||
set(EnableVisuals 1 CACHE BOOL "Enable Visuals")
|
||||
set(LagbotMode 0 CACHE BOOL "Build light cathook made for lagbots")
|
||||
set(ExternalDrawing 0 CACHE BOOL "External Visuals")
|
||||
set(EnableGUI 1 CACHE BOOL "Enable GUI")
|
||||
set(EnableIPC 1 CACHE BOOL "Enable IPC")
|
||||
|
@ -6,7 +6,6 @@
|
||||
#define GAME_SPECIFIC @GameSpecific@
|
||||
#define GAME @Game@
|
||||
#define ENABLE_VISUALS @EnableVisuals@
|
||||
#define LAGBOT_MODE @LagbotMode@
|
||||
#define EXTERNAL_DRAWING @ExternalDrawing@
|
||||
#define ENABLE_GUI @EnableGUI@
|
||||
#define ENABLE_IPC @EnableIPC@
|
||||
|
@ -18,7 +18,6 @@
|
||||
#include "SpyAlert.hpp"
|
||||
|
||||
#endif
|
||||
#if not LAGBOT_MODE
|
||||
#include "Aimbot.hpp"
|
||||
#include "AntiAim.hpp"
|
||||
#include "AntiDisguise.hpp"
|
||||
@ -30,16 +29,12 @@
|
||||
#include "AutoDeadringer.hpp"
|
||||
#include "Bunnyhop.hpp"
|
||||
#include "SeedPrediction.hpp"
|
||||
#endif
|
||||
#if ENABLE_VISUALS
|
||||
#include "Radar.hpp"
|
||||
#endif
|
||||
#if not LAGBOT_MODE
|
||||
#include "Walkbot.hpp"
|
||||
#include "navparser.hpp"
|
||||
#endif
|
||||
#include "AutoJoin.hpp"
|
||||
#if not LAGBOT_MODE
|
||||
#include "AntiBackstab.hpp"
|
||||
#include "AutoBackstab.hpp"
|
||||
#include "FollowBot.hpp"
|
||||
@ -49,16 +44,11 @@
|
||||
#include "DominateSay.hpp"
|
||||
#include "UberSpam.hpp"
|
||||
#include "Achievement.hpp"
|
||||
#endif
|
||||
#include "Spam.hpp"
|
||||
#if not LAGBOT_MODE
|
||||
#include "NavBot.hpp"
|
||||
#include "Noisemaker.hpp"
|
||||
#include "FollowBot.hpp"
|
||||
#include "Announcer.hpp"
|
||||
#include "Killstreak.hpp"
|
||||
#endif
|
||||
#include "CatBot.hpp"
|
||||
#if not LAGBOT_MODE
|
||||
#include "Backtrack.hpp"
|
||||
#endif
|
||||
|
@ -289,13 +289,11 @@ free(logname);*/
|
||||
// hooks::materialsystem.HookMethod();
|
||||
}
|
||||
#endif
|
||||
#if not LAGBOT_MODE
|
||||
// FIXME [MP]
|
||||
hacks::shared::killsay::init();
|
||||
hacks::shared::dominatesay::init();
|
||||
hacks::shared::announcer::init();
|
||||
hacks::tf2::killstreak::init();
|
||||
#endif
|
||||
hacks::shared::catbot::init();
|
||||
logging::Info("Hooked!");
|
||||
velocity::Init();
|
||||
@ -319,9 +317,7 @@ free(logname);*/
|
||||
logging::Info("SDL hooking done");
|
||||
|
||||
#endif /* TEXTMODE */
|
||||
#if not LAGBOT_MODE
|
||||
hacks::shared::anticheat::Init();
|
||||
#endif
|
||||
#if ENABLE_VISUALS
|
||||
#ifndef FEATURE_FIDGET_SPINNER_ENABLED
|
||||
InitSpinner();
|
||||
@ -329,9 +325,7 @@ free(logname);*/
|
||||
#endif
|
||||
hacks::shared::spam::init();
|
||||
#endif
|
||||
#if not LAGBOT_MODE
|
||||
hacks::shared::walkbot::Initialize();
|
||||
#endif
|
||||
#if ENABLE_VISUALS
|
||||
hacks::shared::esp::Init();
|
||||
#endif
|
||||
@ -380,11 +374,9 @@ void hack::Shutdown()
|
||||
#endif
|
||||
logging::Info("Unregistering convars..");
|
||||
ConVar_Unregister();
|
||||
#if not LAGBOT_MODE
|
||||
logging::Info("Shutting down killsay...");
|
||||
hacks::shared::killsay::shutdown();
|
||||
hacks::shared::dominatesay::shutdown();
|
||||
hacks::shared::announcer::shutdown();
|
||||
#endif
|
||||
logging::Info("Success..");
|
||||
}
|
||||
|
@ -149,7 +149,6 @@ void updateSearch()
|
||||
#endif
|
||||
}
|
||||
static HookedFunction update(HookedFunctions_types::HF_CreateMove, "Autojoin", 1, []() {
|
||||
#if !LAGBOT_MODE
|
||||
if (autoteam_timer.test_and_set(500))
|
||||
{
|
||||
if (autojoin_team and UnassignedTeam())
|
||||
@ -162,7 +161,6 @@ static HookedFunction update(HookedFunctions_types::HF_CreateMove, "Autojoin", 1
|
||||
g_IEngine->ExecuteClientCmd(format("join_class ", classnames[int(autojoin_class) - 1]).c_str());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
});
|
||||
|
||||
void onShutdown()
|
||||
|
@ -3,7 +3,6 @@ target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CatBot.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/SeedPrediction.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Spam.cpp")
|
||||
if(NOT LagbotMode)
|
||||
target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Achievement.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Aimbot.cpp"
|
||||
@ -37,7 +36,6 @@ if(NOT LagbotMode)
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Walkbot.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/Radar.cpp")
|
||||
add_subdirectory(ac)
|
||||
endif()
|
||||
if(EnableVisuals)
|
||||
target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ESP.cpp"
|
||||
|
@ -131,7 +131,6 @@ InitRoutine init([]() { teammatesPushaway = g_ICvar->FindVar("tf_avoidteammates_
|
||||
|
||||
void CreateMove()
|
||||
{
|
||||
#if !LAGBOT_MODE
|
||||
if (current_user_cmd->command_number)
|
||||
last_number = current_user_cmd->command_number;
|
||||
|
||||
@ -225,7 +224,6 @@ void CreateMove()
|
||||
if (*nopush_enabled == teammatesPushaway->GetBool())
|
||||
teammatesPushaway->SetValue(!nopush_enabled);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if ENABLE_VISUALS
|
||||
|
@ -33,19 +33,6 @@ static settings::Bool no_shake{ "visual.no-shake", "true" };
|
||||
#endif
|
||||
|
||||
class CMoveData;
|
||||
#if LAGBOT_MODE
|
||||
CatCommand set_value("set", "Set value", [](const CCommand &args) {
|
||||
if (args.ArgC() < 2)
|
||||
return;
|
||||
ConVar *var = g_ICvar->FindVar(args.Arg(1));
|
||||
if (!var)
|
||||
return;
|
||||
std::string value(args.Arg(2));
|
||||
ReplaceString(value, "\\n", "\n");
|
||||
var->SetValue(value.c_str());
|
||||
logging::Info("Set '%s' to '%s'", args.Arg(1), value.c_str());
|
||||
});
|
||||
#endif
|
||||
namespace engine_prediction
|
||||
{
|
||||
|
||||
@ -101,11 +88,6 @@ void RunEnginePrediction(IClientEntity *ent, CUserCmd *ucmd)
|
||||
return;
|
||||
}
|
||||
} // namespace engine_prediction
|
||||
#if not LAGBOT_MODE
|
||||
#define antikick_time 35
|
||||
#else
|
||||
#define antikick_time 90
|
||||
#endif
|
||||
|
||||
static int attackticks = 0;
|
||||
|
||||
@ -133,13 +115,11 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, CUs
|
||||
|
||||
tickcount++;
|
||||
current_user_cmd = cmd;
|
||||
#if !LAGBOT_MODE
|
||||
IF_GAME(IsTF2C())
|
||||
{
|
||||
if (CE_GOOD(LOCAL_W) && minigun_jump && LOCAL_W->m_iClassID() == CL_CLASS(CTFMinigun))
|
||||
CE_INT(LOCAL_W, netvar.iWeaponState) = 0;
|
||||
}
|
||||
#endif
|
||||
ret = original::CreateMove(this_, input_sample_time, cmd);
|
||||
|
||||
PROF_SECTION(CreateMove);
|
||||
@ -307,7 +287,6 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, CUs
|
||||
{
|
||||
if (!g_pLocalPlayer->life_state && CE_GOOD(g_pLocalPlayer->weapon()))
|
||||
{
|
||||
#if !LAGBOT_MODE
|
||||
// Walkbot can leave game.
|
||||
if (!g_IEngine->IsInGame())
|
||||
{
|
||||
@ -405,9 +384,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, CUs
|
||||
if (debug_projectiles)
|
||||
projectile_logging::Update();
|
||||
Prediction_CreateMove();
|
||||
#endif
|
||||
}
|
||||
#if !LAGBOT_MODE
|
||||
{
|
||||
PROF_SECTION(CM_misc);
|
||||
hacks::shared::misc::CreateMove();
|
||||
@ -416,27 +393,22 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, CUs
|
||||
PROF_SECTION(CM_crits);
|
||||
criticals::create_move();
|
||||
}
|
||||
#endif
|
||||
{
|
||||
PROF_SECTION(CM_spam);
|
||||
hacks::shared::spam::createMove();
|
||||
}
|
||||
#if !LAGBOT_MODE
|
||||
{
|
||||
PROF_SECTION(CM_AC);
|
||||
hacks::shared::anticheat::CreateMove();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if (time_replaced)
|
||||
g_GlobalVars->curtime = curtime_old;
|
||||
g_Settings.bInvalid = false;
|
||||
#if !LAGBOT_MODE
|
||||
{
|
||||
PROF_SECTION(CM_chat_stack);
|
||||
chat_stack::OnCreateMove();
|
||||
}
|
||||
#endif
|
||||
|
||||
// TODO Auto Steam Friend
|
||||
|
||||
@ -451,7 +423,6 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, CUs
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if !LAGBOT_MODE
|
||||
hacks::shared::backtrack::UpdateIncomingSequences();
|
||||
if (CE_GOOD(g_pLocalPlayer->entity))
|
||||
{
|
||||
@ -523,7 +494,6 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, CUs
|
||||
g_Settings.brute.choke[i].pop_front();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// PROF_END("CreateMove");
|
||||
if (!(cmd->buttons & IN_ATTACK))
|
||||
|
@ -187,7 +187,6 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type, bf_read &
|
||||
if (crypt_chat && message.find("!!B") == 0 && ucccccp::validate(message))
|
||||
{
|
||||
std::string msg = ucccccp::decrypt(message);
|
||||
#if !LAGBOT_MODE
|
||||
CachedEntity *ent = ENTITY(data[0]);
|
||||
if (msg != "Attempt at ucccccping and failing" && msg != "Unsupported version" && ent != LOCAL_E)
|
||||
{
|
||||
@ -197,7 +196,6 @@ DEFINE_HOOKED_METHOD(DispatchUserMessage, bool, void *this_, int type, bf_read &
|
||||
state = playerlist::k_EState::CAT;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
PrintChat("\x07%06X%s\x01: %s", 0xe05938, name.c_str(), msg.c_str());
|
||||
}
|
||||
chatlog::LogMessage(data[0], message);
|
||||
|
@ -22,15 +22,11 @@ namespace hooked_methods
|
||||
|
||||
DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name)
|
||||
{
|
||||
#if !LAGBOT_MODE
|
||||
hacks::shared::backtrack::lastincomingsequencenumber = 0;
|
||||
hacks::shared::backtrack::sequences.clear();
|
||||
#endif
|
||||
firstcm = true;
|
||||
// nav::init = false;
|
||||
#if !LAGBOT_MODE
|
||||
playerlist::Save();
|
||||
#endif
|
||||
#if ENABLE_VISUALS
|
||||
#if ENABLE_GUI
|
||||
gui::onLevelLoad();
|
||||
@ -55,14 +51,12 @@ DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name)
|
||||
for (int i = 0; i < 32; i++)
|
||||
g_Settings.brute.brutenum[i] = 0;
|
||||
g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec");
|
||||
#if !LAGBOT_MODE
|
||||
hacks::shared::aimbot::Reset();
|
||||
hacks::shared::backtrack::Init();
|
||||
chat_stack::Reset();
|
||||
hacks::shared::anticheat::ResetEverything();
|
||||
original::LevelInit(this_, name);
|
||||
hacks::shared::walkbot::OnLevelInit();
|
||||
#endif
|
||||
#if ENABLE_IPC
|
||||
if (ipc::peer)
|
||||
{
|
||||
|
@ -13,15 +13,11 @@ namespace hooked_methods
|
||||
DEFINE_HOOKED_METHOD(LevelShutdown, void, void *this_)
|
||||
{
|
||||
need_name_change = true;
|
||||
#if !LAGBOT_MODE
|
||||
playerlist::Save();
|
||||
#endif
|
||||
g_Settings.bInvalid = true;
|
||||
#if !LAGBOT_MODE
|
||||
hacks::shared::aimbot::Reset();
|
||||
chat_stack::Reset();
|
||||
hacks::shared::anticheat::ResetEverything();
|
||||
#endif
|
||||
#if ENABLE_IPC
|
||||
if (ipc::peer)
|
||||
{
|
||||
|
@ -24,9 +24,7 @@ DEFINE_HOOKED_METHOD(Paint, void, IEngineVGui *this_, PaintMode_t mode)
|
||||
|
||||
if (mode & PaintMode_t::PAINT_UIPANELS)
|
||||
{
|
||||
#if not LAGBOT_MODE
|
||||
hacks::tf2::killstreak::apply_killstreaks();
|
||||
#endif
|
||||
hacks::shared::catbot::update();
|
||||
hitrate::Update();
|
||||
#if ENABLE_ONLINE
|
||||
|
@ -12,7 +12,6 @@ DEFINE_HOOKED_METHOD(SendDatagram, int, INetChannel *ch, bf_write *buf)
|
||||
{
|
||||
if (!round(hacks::shared::backtrack::getLatency()))
|
||||
return original::SendDatagram(ch, buf);
|
||||
#if !LAGBOT_MODE
|
||||
int in = 0;
|
||||
int state = 0;
|
||||
if (CE_GOOD(LOCAL_E) && ch)
|
||||
@ -23,17 +22,13 @@ DEFINE_HOOKED_METHOD(SendDatagram, int, INetChannel *ch, bf_write *buf)
|
||||
float latencysend = round((round((hacks::shared::backtrack::getLatency() - 0.5f) / 15.1515151515f) - 0.5f) * 15.1515151515f);
|
||||
hacks::shared::backtrack::AddLatencyToNetchan(ch, latencysend);
|
||||
}
|
||||
#endif
|
||||
|
||||
int ret = original::SendDatagram(ch, buf);
|
||||
#if !LAGBOT_MODE
|
||||
if (CE_GOOD(LOCAL_E) && ch)
|
||||
{
|
||||
ch->m_nInSequenceNr = in;
|
||||
ch->m_nInReliableState = state;
|
||||
}
|
||||
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
} // namespace hooked_methods
|
||||
|
@ -8,9 +8,7 @@
|
||||
#include <settings/Bool.hpp>
|
||||
#include <hacks/Thirdperson.hpp>
|
||||
#include "HookedMethods.hpp"
|
||||
#if not LAGBOT_MODE
|
||||
#include "hacks/Backtrack.hpp"
|
||||
#endif
|
||||
|
||||
static settings::Float nightmode{ "visual.night-mode", "0" };
|
||||
static settings::Bool no_shake{ "visual.no-shake", "true" };
|
||||
|
Reference in New Issue
Block a user