diff --git a/.gitignore b/.gitignore index f61acd3c..d7f77315 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,253 @@ -*.d +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +[Xx]64/ +[Xx]86/ +[Bb]uild/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml + +# TODO: Un-comment the next line if you do not want to checkin +# your web deploy settings because they may include unencrypted +# passwords +#*.pubxml +*.publishproj + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directory +AppPackages/ +BundleArtifacts/ + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# LightSwitch generated files +GeneratedArtifacts/ +ModelManifest.xml + +# Paket dependency manager +.paket/paket.exe + +# FAKE - F# Make +.fake/ + + +## Ignore .o and .d files (objects and dependencies) *.o -/bin/* +*.d + +# Don't ignore binary resource files !res/bin/* -/core -Debug/ -.vs/cathook/v15/Browse.VC.db -TFLOC -Data Folder \ No newline at end of file + +## Ignore Data Folder symlink +Data Folder diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json deleted file mode 100644 index f8b48885..00000000 --- a/.vs/ProjectSettings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "CurrentProjectSetting": null -} \ No newline at end of file diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json deleted file mode 100644 index 62afdc15..00000000 --- a/.vs/VSWorkspaceState.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "ExpandedNodes": [ - "", - "\\src", - "\\src\\hacks" - ], - "PreviewInSolutionExplorer": false -} \ No newline at end of file diff --git a/.vs/cathook/v15/.suo b/.vs/cathook/v15/.suo deleted file mode 100644 index 831440fc..00000000 Binary files a/.vs/cathook/v15/.suo and /dev/null differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite deleted file mode 100644 index 0b906d87..00000000 Binary files a/.vs/slnx.sqlite and /dev/null differ diff --git a/README.md b/README.md index 2580af74..a32d4f0f 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ sudo apt update && sudo apt install build-essential software-properties-common - Arch dependencies installation:: ```bash -sudo pacman -Syu && sudo pacman -S gdb gdb-common glew1.10 lib32-glew1.10 --noconfirm && yes | sudo pacman -U https://archive.archlinux.org/packages/g/gcc-multilib/gcc-multilib-6.3.1-2-x86_64.pkg.tar.xz https://archive.archlinux.org/packages/g/gcc-libs-multilib/gcc-libs-multilib-6.3.1-2-x86_64.pkg.tar.xz https://archive.archlinux.org/packages/l/lib32-gcc-libs/lib32-gcc-libs-6.3.1-2-x86_64.pkg.tar.xz +sudo pacman -Syu && sudo pacman -S gdb gdb-common glew1.10 lib32-glew1.10 rsync --noconfirm && yes | sudo pacman -U https://archive.archlinux.org/packages/g/gcc-multilib/gcc-multilib-6.3.1-2-x86_64.pkg.tar.xz https://archive.archlinux.org/packages/g/gcc-libs-multilib/gcc-libs-multilib-6.3.1-2-x86_64.pkg.tar.xz https://archive.archlinux.org/packages/l/lib32-gcc-libs/lib32-gcc-libs-6.3.1-2-x86_64.pkg.tar.xz ``` diff --git a/cathook.vcxproj.user b/cathook.vcxproj.user deleted file mode 100644 index 0b0f24d5..00000000 --- a/cathook.vcxproj.user +++ /dev/null @@ -1,6 +0,0 @@ - - - - true - - \ No newline at end of file diff --git a/src/conditions.h b/src/conditions.h index 3ef2b189..2717407a 100644 --- a/src/conditions.h +++ b/src/conditions.h @@ -255,7 +255,7 @@ inline void CondBitSet(condition_data_s& data) { template inline bool HasCondition(CachedEntity* ent) { IF_GAME (!IsTF()) return false; - IF_GAME (IsTF2()) { + IF_GAME (IsTF2() && cond < condition(96)) { if (CondBitCheck(CE_VAR(ent, netvar._condition_bits, condition_data_s))) return true; } return CondBitCheck(CE_VAR(ent, netvar.iCond, condition_data_s)); diff --git a/src/hacks/ESP.cpp b/src/hacks/ESP.cpp index a19815cb..4ba4ca9b 100644 --- a/src/hacks/ESP.cpp +++ b/src/hacks/ESP.cpp @@ -26,6 +26,7 @@ CatVar item_health_packs(CV_SWITCH, "esp_item_health", "1", "Health packs", "Sho CatVar item_powerups(CV_SWITCH, "esp_item_powerups", "1", "Powerups", "Show powerups"); CatVar item_money(CV_SWITCH, "esp_money", "1", "MvM money", "Show MvM money"); CatVar item_money_red(CV_SWITCH, "esp_money_red", "1", "Red MvM money", "Show red MvM money"); +CatVar item_spellbooks(CV_SWITCH, "esp_spellbooks", "1", "Spellbooks", "Spell Books"); CatVar entity_id(CV_SWITCH, "esp_entity_id", "1", "Entity ID", "Used with Entity ESP. Shows entityID"); CatVar tank(CV_SWITCH, "esp_show_tank", "1", "Show tank", "Show tank"); CatVar box_esp(CV_SWITCH, "esp_box", "1", "Box", "Draw 2D box with healthbar. fancy."); @@ -367,6 +368,12 @@ void _FASTCALL ProcessEntity(CachedEntity* ent) { } else if (item_weapon_spawners && ent->m_ItemType >= ITEM_TF2C_W_FIRST && ent->m_ItemType <= ITEM_TF2C_W_LAST) { AddEntityString(ent, format(tf2c_weapon_names[ent->m_ItemType - ITEM_TF2C_W_FIRST], " SPAWNER")); if (CE_BYTE(ent, netvar.bRespawning)) AddEntityString(ent, "-- RESPAWNING --"); + } else if (item_spellbooks && (ent->m_ItemType == ITEM_SPELL || ent->m_ItemType == ITEM_SPELL_RARE)) { + if (ent->m_ItemType == ITEM_SPELL) { + AddEntityString(ent, "Spell", colors::green); + } else { + AddEntityString(ent, "Rare Spell", colors::FromRGBA8(139, 31, 221, 255)); + } } } else if (ent->m_Type == ENTITY_BUILDING && buildings) { if (!ent->m_bEnemy && !teammates) return; diff --git a/src/hacks/LagExploit.cpp b/src/hacks/LagExploit.cpp index 7dee6ae6..4799835d 100644 --- a/src/hacks/LagExploit.cpp +++ b/src/hacks/LagExploit.cpp @@ -58,6 +58,7 @@ bool ExploitActive() { static CatVar mini_lag_exploit(CV_INT, "lagexploit_mini", "0", "Mini Lag Exploit"); static CatVar instant_weapon_switch(CV_SWITCH, "instant_weapon_switch", "0", "Instant weapon switch"); +static CatVar infinite_packs(CV_SWITCH, "infinite_healthpacks", "0", "Infinite Healthpacks", "Activate removecond when standing on healthpack while having not full HP"); void CreateMove() { if (CE_BAD(LOCAL_E)) return; @@ -145,6 +146,31 @@ void CreateMove() { if (!ExploitActive()) { amount = int(mini_lag_exploit); } + + // Infinite healthpacks (I'll probably have to move this somewhere else) + if (infinite_packs && CE_GOOD(LOCAL_E) && LOCAL_E->m_iHealth != LOCAL_E->m_iMaxHealth) { + ICollideable* p = RAW_ENT(LOCAL_E)->GetCollideable(); + const Vector& max1 = p->OBBMaxs(); + const Vector& min1 = p->OBBMins(); + for (int i = 1; i < entity_cache::max; i++) { + CachedEntity* e = ENTITY(i); + if (e->m_iClassID != CL_CLASS(CBaseAnimating)) continue; + if (e->m_ItemType != ITEM_HEALTH_SMALL && e->m_ItemType != ITEM_HEALTH_MEDIUM && e->m_ItemType != ITEM_HEALTH_LARGE) continue; + if (e->m_flDistance < 54.0f) amount = 900; + // Not working for some reason? + /*ICollideable* c = RAW_ENT(e)->GetCollideable(); + const Vector& max2 = c->OBBMaxs(); + const Vector& min2 = c->OBBMins(); + if ( (min1.x <= max2.x && max1.x >= min2.x) && + (min1.y <= max2.y && max1.y >= min2.y) && + (min1.z <= max2.z && max1.z >= min2.z) ) { + logging::Info("Collision with %d", i); + amount = 900; + break; + }*/ + } + } + if (!amount) return; // Modifying command_number and lastoutgoingcommand turned out to be useless diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index 0b3d3fcb..24e88a22 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -356,7 +356,7 @@ bool CreateMove_hook(void* thisptr, float inputSample, CUserCmd* cmd) { if (CE_GOOD(g_pLocalPlayer->entity)) { static int fakelag_queue = 0; if (fakelag_amount) { - if (fakelag_queue == int(fakelag_amount)) { + if (fakelag_queue == int(fakelag_amount) || (g_pUserCmd->buttons & IN_ATTACK)) { *bSendPackets = true; } else if (fakelag_queue < int(fakelag_amount)) { *bSendPackets = false; diff --git a/src/hooks/others.cpp b/src/hooks/others.cpp index 40297113..9d3a0b20 100644 --- a/src/hooks/others.cpp +++ b/src/hooks/others.cpp @@ -169,15 +169,15 @@ bool SendNetMsg_hook(void* _this, INetMessage& msg, bool bForceReliable = false, } static ConVar* sv_player_usercommand_timeout = g_ICvar->FindVar("sv_player_usercommand_timeout"); static float lastcmd = 0.0f; - if (lastcmd > g_GlobalVars->curtime) { - lastcmd = g_GlobalVars->curtime; + if (lastcmd > g_GlobalVars->absoluteframetime) { + lastcmd = g_GlobalVars->absoluteframetime; } if (airstuck.KeyDown() && !g_Settings.bInvalid) { if (CE_GOOD(LOCAL_E)) { - if (lastcmd + sv_player_usercommand_timeout->GetFloat() - 0.05f < g_GlobalVars->curtime) { + if (lastcmd + sv_player_usercommand_timeout->GetFloat() - 0.1f < g_GlobalVars->curtime) { if (msg.GetType() == clc_Move) return false; } else { - lastcmd = g_GlobalVars->curtime; + lastcmd = g_GlobalVars->absoluteframetime; } } } diff --git a/src/itemtypes.cpp b/src/itemtypes.cpp index 05180f79..f6c7b1e5 100644 --- a/src/itemtypes.cpp +++ b/src/itemtypes.cpp @@ -61,6 +61,10 @@ ItemManager::ItemManager() : mapper() { RegisterModelMapping("models/items/healthkit.mdl", ITEM_HEALTH_MEDIUM); //RegisterModelMapping("models/pickups/pickup_powerup_reflect.mdl", ITEM_POWERUP_REFLECT); + // Spellbooks + RegisterModelMapping("models/props_halloween/hwn_spellbook_upright.mdl", ITEM_SPELL); + RegisterModelMapping("models/props_halloween/hwn_spellbook_upright_major.mdl", ITEM_SPELL_RARE); + RegisterSpecialMapping([](CachedEntity* ent) -> bool { return ent->m_iClassID == CL_CLASS(CTFAmmoPack); }, ITEM_AMMO_MEDIUM); diff --git a/src/itemtypes.h b/src/itemtypes.h index 3e47eab8..d6d2913f 100644 --- a/src/itemtypes.h +++ b/src/itemtypes.h @@ -144,6 +144,9 @@ enum k_EItemType { ITEM_HL_BATTERY, + ITEM_SPELL, + ITEM_SPELL_RARE, + ITEM_COUNT };