Merge pull request #8 from nullifiedcat/master

update fork for push
This commit is contained in:
julianacat 2017-07-16 21:35:18 -05:00 committed by GitHub
commit e45acd8805
12 changed files with 51 additions and 25 deletions

View File

@ -27,7 +27,7 @@ and a lot of useful features, including
Ubuntu dependencies installation:
```bash
sudo apt update && sudo apt install build-essential software-properties-common -y && sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sudo apt install gcc-snapshot -y && sudo apt update && sudo apt install git libc6-dev gcc-6 g++-6 libc6-dev:i386 g++-6-multilib gdb libsdl2-dev libglew-dev libfreetype6-dev libfreetype6-dev:i386 -y &&
sudo apt update && sudo apt install build-essential software-properties-common -y && sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt update && sudo apt install gcc-snapshot -y && sudo apt update && sudo apt install git libc6-dev gcc-6 g++-6 libc6-dev:i386 g++-6-multilib gdb libsdl2-dev libglew-dev libfreetype6-dev libfreetype6-dev:i386 -y
```

View File

@ -14,7 +14,7 @@ int g_AppID = 0;
void ThirdpersonCallback(IConVar* var, const char* pOldValue, float flOldValue) {
if (force_thirdperson.convar_parent && !force_thirdperson) {
if (g_pLocalPlayer && g_pLocalPlayer->entity)
if (g_pLocalPlayer && CE_GOOD(g_pLocalPlayer->entity))
CE_INT(g_pLocalPlayer->entity, netvar.nForceTauntCam) = 0;
}
}

View File

@ -31,6 +31,7 @@ void CatVar_Integer(CatVar& var) {
int value = var;
ImGui::PushItemWidth(120.0f);
int step = var.restricted ? (var.max - var.min) / 50 : 1;
if (step == 0) step = 1;
if (ImGui::InputInt(label, &value, step, step * 20)) {
var = value;
}

View File

@ -272,6 +272,7 @@ void hack::Initialize() {
hacks::shared::anticheat::Init();
hacks::tf2::healarrow::Init();
InitSpinner();
hacks::shared::spam::Init();
logging::Info("Initialized Fidget Spinner");
}

View File

@ -17,7 +17,7 @@ CatVar enabled(CV_SWITCH, "reflect_enabled", "0", "Auto Reflect", "Master AutoRe
CatVar idle_only(CV_SWITCH, "reflect_only_idle", "0", "Only when not shooting", "Don't AutoReflect if you're holding M1");
CatVar legit(CV_SWITCH, "reflect_legit", "0", "Legit Reflect", "Only Auto-airblasts projectiles that you can see, doesnt move your crosshair");
CatVar dodgeball(CV_SWITCH, "reflect_dodgeball", "0", "Dodgeball Mode", "Allows auto-reflect to work in dodgeball servers");
CatVar blastkey(CV_KEY, "reflect_key", "0", "Reflect Key", "Hold this key to activate auto-airblast");
CatVar stickies(CV_SWITCH, "reflect_stickybombs", "0", "Reflect stickies", "Reflect Stickybombs");
// TODO setup proj sorting
// TODO CatVar big_proj(CV_SWITCH, "reflect_big_projectile", "0", "Reflect big projectiles", "Reflect Rockets");
@ -29,6 +29,7 @@ CatVar stickies(CV_SWITCH, "reflect_stickybombs", "0", "Reflect stickies", "Refl
void CreateMove() {
// Check if user settings allow Auto Reflect
if (!enabled) return;
if (blastkey && !blastkey.KeyDown()) return;
// Check if player is using a flame thrower
if (g_pLocalPlayer->weapon()->m_iClassID != CL_CLASS(CTFFlameThrower)) return;

View File

@ -82,6 +82,9 @@ void Reload() {
void Init() {
g_IEventManager2->AddListener(&getListener(), (const char*)"player_death", false);
filename.InstallChangeCallback([](IConVar* var, const char* pszOV, float flOV) {
file.TryLoad(std::string(filename.GetString()));
});
}
void Shutdown() {

View File

@ -144,6 +144,12 @@ int QueryPlayer(Query query) {
return index_result;
}
void Init() {
filename.InstallChangeCallback([](IConVar* var, const char* pszOV, float flOV) {
file.TryLoad(std::string(filename.GetString()));
});
}
bool SubstituteQueries(std::string& input) {
size_t index = input.find("%query:");
while (index != std::string::npos) {

View File

@ -25,6 +25,7 @@ extern CatVar enabled;
extern CatVar filename;
extern CatCommand reload;
void Init();
void CreateMove();
void Reset();
void Reload();

View File

@ -13,25 +13,6 @@
#include "hookedmethods.h"
#include <link.h>
// FIXME remove this temporary code already!
float AngleDiff( float destAngle, float srcAngle )
{
float delta;
delta = fmodf(destAngle - srcAngle, 360.0f);
if ( destAngle > srcAngle )
{
if ( delta >= 180 )
delta -= 360;
}
else
{
if ( delta <= -180 )
delta += 360;
}
return delta;
}
#include "../profiler.h"
static CatVar minigun_jump(CV_SWITCH, "minigun_jump", "0", "TF2C minigun jump", "Allows jumping while shooting with minigun");
@ -39,6 +20,8 @@ static CatVar minigun_jump(CV_SWITCH, "minigun_jump", "0", "TF2C minigun jump",
CatVar jointeam(CV_SWITCH, "fb_autoteam", "1", "Joins player team automatically (NYI)");
CatVar joinclass(CV_STRING, "fb_autoclass", "spy", "Class that will be picked after joining a team (NYI)");
CatVar nolerp(CV_SWITCH, "nolerp", "0", "NoLerp mode (experimental)");
class CMoveData;
namespace engine_prediction {
@ -180,6 +163,17 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) {
time_replaced = false;
curtime_old = g_GlobalVars->curtime;
static ConVar* sv_client_min_interp_ratio = g_ICvar->FindVar("sv_client_min_interp_ratio");
static ConVar* cl_interp = g_ICvar->FindVar("cl_interp");
static ConVar* cl_interp_ratio = g_ICvar->FindVar("cl_interp_ratio");
if (nolerp) {
g_pUserCmd->tick_count += 1;
if (sv_client_min_interp_ratio->GetInt() != -1) sv_client_min_interp_ratio->SetValue(-1);
if (cl_interp->GetInt() != 0) cl_interp->SetValue(0);
if (cl_interp_ratio->GetInt() != 0) cl_interp_ratio->SetValue(0);
}
if (!g_Settings.bInvalid && CE_GOOD(g_pLocalPlayer->entity)) {
servertime = (float)CE_INT(g_pLocalPlayer->entity, netvar.nTickBase) * g_GlobalVars->interval_per_tick;
g_GlobalVars->curtime = servertime;
@ -188,6 +182,9 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) {
if (g_Settings.bInvalid) {
entity_cache::Invalidate();
}
// Disabled because this causes EXTREME aimbot inaccuracy
//if (!cmd->command_number) return ret;
// PROF_BEGIN();
{
PROF_SECTION(EntityCache);
@ -203,8 +200,6 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) {
SAFE_CALL(g_pLocalPlayer->Update());
}
g_Settings.bInvalid = false;
// Disabled because this causes EXTREME aimbot inaccuracy
//if (!cmd->command_number) return ret;
#ifdef IPC_ENABLED
static int team_joining_state = 0;
static float last_jointeam_try = 0;

View File

@ -18,6 +18,21 @@
TextFile::TextFile()
: lines {} {}
bool TextFile::TryLoad(std::string name) {
if (name.length() == 0) return false;
std::string filename = format("cathook/", name);
std::ifstream file(filename, std::ios::in);
if (!file) {
return false;
}
lines.clear();
for (std::string line; std::getline(file, line);) {
if (*line.rbegin() == '\r') line.erase(line.length() - 1, 1);
lines.push_back(line);
}
return true;
}
void TextFile::Load(std::string name) {
std::string filename = format("cathook/", name);
std::ifstream file(filename, std::ios::in);
@ -27,6 +42,7 @@ void TextFile::Load(std::string name) {
}
lines.clear();
for (std::string line; std::getline(file, line);) {
if (*line.rbegin() == '\r') line.erase(line.length() - 1, 1);
lines.push_back(line);
}
}

View File

@ -17,6 +17,7 @@ class TextFile {
public:
TextFile();
void Load(std::string filename);
bool TryLoad(std::string filename);
size_t LineCount() const;
const std::string& Line(size_t id) const;
public:

View File

@ -113,7 +113,8 @@
"reflect_legit",
"reflect_only_idle",
"reflect_stickybombs",
"reflect_dodgeball"
"reflect_dodgeball",
"reflect_key"
]
},
{