Merge pull request #530 from TotallyNotElite/backtrackfix

Fix Backtrack not recognizing non-melee weapons correctly
This commit is contained in:
LightCat 2018-07-20 21:08:59 +02:00 committed by GitHub
commit 89bd86807b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 7 deletions

View File

@ -11,7 +11,7 @@ rm ../install-all # remove install file
# Install base Dependencies
#
if [ -f "/etc/arch-release" ]; then
sudo pacman -S --needed --noconfirm boost cmake make lib32-openssl lib32-libpng gcc gdb lib32-sdl2 lib32-glew freetype2
sudo pacman -S --needed --noconfirm boost cmake make lib32-openssl lib32-libpng gcc gdb lib32-sdl2 lib32-glew freetype2 rsync
else
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
sudo apt update

View File

@ -201,7 +201,8 @@ bool BacktrackAimbot()
{
bool good_tick = false;
for (int j = 0; j < 12; ++j)
if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && hacks::shared::backtrack::sorted_ticks[j].tickcount != FLT_MAX)
if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick &&
hacks::shared::backtrack::sorted_ticks[j].tickcount != INT_MAX)
good_tick = true;
tickcnt++;
if (!i.hitboxpos.z)

View File

@ -52,7 +52,7 @@ void CreateMove()
{
bool good_tick = false;
for (int j = 0; j < 12; ++j)
if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick)
if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && hacks::shared::backtrack::sorted_ticks[j].tickcount != INT_MAX)
good_tick = true;
tickcnt++;
if (!good_tick)

View File

@ -9,8 +9,10 @@
#include "hacks/Backtrack.hpp"
#include <boost/circular_buffer.hpp>
#include <glez/draw.hpp>
#define IsMelee GetWeaponMode() == weapon_melee
bool IsMelee()
{
return GetWeaponMode() == weapon_melee;
}
namespace hacks::shared::backtrack
{
CatVar enable(CV_SWITCH, "backtrack", "0", "Enable backtrack",
@ -174,7 +176,8 @@ void Run()
{
bool good_tick = false;
for (int i = 0; i < 12; ++i)
if (t == sorted_ticks[i].tick && sorted_ticks[i].tickcount != FLT_MAX)
if (t == sorted_ticks[i].tick &&
sorted_ticks[i].tickcount != INT_MAX && sorted_ticks[i].tickcount)
good_tick = true;
if (!good_tick)
continue;

View File

@ -86,7 +86,7 @@ bool CanBacktrack()
{
bool good_tick = false;
for (int j = 0; j < 12; ++j)
if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick)
if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && hacks::shared::backtrack::sorted_ticks[j].tickcount != INT_MAX)
good_tick = true;
tickcnt++;
if (!good_tick)