Fix backtrack crashes

This commit is contained in:
bencat07 2019-06-02 21:39:03 +02:00
parent b24671c10e
commit caa9e7c84e
6 changed files with 7 additions and 10 deletions

View File

@ -114,7 +114,7 @@ endif()
configure_file(include/config.h.in ${CMAKE_SOURCE_DIR}/include/config.h @ONLY) configure_file(include/config.h.in ${CMAKE_SOURCE_DIR}/include/config.h @ONLY)
configure_file(include/version.h.in ${CMAKE_SOURCE_DIR}/include/version.h @ONLY) configure_file(include/version.h.in ${CMAKE_SOURCE_DIR}/include/version.h @ONLY)
set(CMAKE_CXX_FLAGS "-m32 -march=native -fexceptions -fno-gnu-unique -DNDEBUG") set(CMAKE_CXX_FLAGS "-m32 -march=native -fexceptions -DNDEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-rdynamic -ggdb -Og") set(CMAKE_CXX_FLAGS_DEBUG "-rdynamic -ggdb -Og")
set(CMAKE_CXX_FLAGS_RELEASE "-O3") set(CMAKE_CXX_FLAGS_RELEASE "-O3")

View File

@ -61,7 +61,7 @@ struct CIncomingSequence
}; };
typedef boost::circular_buffer_space_optimized<CIncomingSequence> circular_buf; typedef boost::circular_buffer_space_optimized<CIncomingSequence> circular_buf;
extern circular_buf sequences; extern circular_buf sequences;
extern BacktrackData headPositions[32][66]; extern BacktrackData headPositions[33][66];
extern bool isBacktrackEnabled; extern bool isBacktrackEnabled;
extern bool Vischeck_Success; extern bool Vischeck_Success;

View File

@ -187,7 +187,7 @@ constexpr rgba_t Health_dimgreen(int health, int max)
float hf = float(health) / float(max); float hf = float(health) / float(max);
if (hf > 1) if (hf > 1)
{ {
return colors::FromRGBA8(0, 128, 0, 255); return colors::FromRGBA8(0, 128, 255, 255);
} }
rgba_t to_return{ 0.0f, 0.0f, 0.0f, 1.0f }; rgba_t to_return{ 0.0f, 0.0f, 0.0f, 1.0f };

View File

@ -29,7 +29,7 @@ void EmptyBacktrackData(BacktrackData &i);
std::pair<int, int> getBestEntBestTick(); std::pair<int, int> getBestEntBestTick();
bool shouldBacktrack(); bool shouldBacktrack();
BacktrackData headPositions[32][66]{}; BacktrackData headPositions[33][66]{};
int lastincomingsequencenumber = 0; int lastincomingsequencenumber = 0;
bool isBacktrackEnabled = false; bool isBacktrackEnabled = false;
bool Vischeck_Success = false; bool Vischeck_Success = false;
@ -73,7 +73,7 @@ void AddLatencyToNetchan(INetChannel *ch)
} }
void Init() void Init()
{ {
for (int i = 0; i < 32; i++) for (int i = 0; i < 33; i++)
for (int j = 0; j < 66; j++) for (int j = 0; j < 66; j++)
headPositions[i][j] = {}; headPositions[i][j] = {};

View File

@ -1117,10 +1117,7 @@ void _FASTCALL ProcessEntity(CachedEntity *ent)
// Health esp // Health esp
if ((int) show_health == 1 || (int) show_health == 3) if ((int) show_health == 1 || (int) show_health == 3)
{ {
if (RAW_ENT(ent)->IsDormant()) AddEntityString(ent, format(ent->m_iHealth(), '/', ent->m_iMaxHealth(), " HP"), colors::Health(ent->m_iHealth(), ent->m_iMaxHealth()));
AddEntityString(ent, "?/? HP", colors::black);
else
AddEntityString(ent, format(ent->m_iHealth(), '/', ent->m_iMaxHealth(), " HP"), colors::Health(ent->m_iHealth(), ent->m_iMaxHealth()));
} }
IF_GAME(IsTF()) IF_GAME(IsTF())
{ {

View File

@ -429,7 +429,7 @@ void Schema_Reload()
static auto GetItemSchema = reinterpret_cast<void *(*) (void)>(gSignatures.GetClientSignature("55 89 E5 57 56 53 83 EC ? 8B 1D ? ? ? ? 85 DB 89 D8")); static auto GetItemSchema = reinterpret_cast<void *(*) (void)>(gSignatures.GetClientSignature("55 89 E5 57 56 53 83 EC ? 8B 1D ? ? ? ? 85 DB 89 D8"));
static auto BInitTextBuffer = reinterpret_cast<bool (*)(void *, CUtlBuffer &, int)>(gSignatures.GetClientSignature("55 89 E5 57 56 53 8D 9D ? ? ? ? 81 EC ? ? ? ? 8B 7D ? 89 1C 24 ")); static auto BInitTextBuffer = reinterpret_cast<bool (*)(void *, CUtlBuffer &, int)>(gSignatures.GetClientSignature("55 89 E5 57 56 53 8D 9D ? ? ? ? 81 EC ? ? ? ? 8B 7D ? 89 1C 24 "));
void *schema = GetItemSchema() + 0x4; void *schema = (void *) ((unsigned) GetItemSchema() + 0x4);
FILE *file = fopen("/opt/cathook/data/items_game.txt", "r"); FILE *file = fopen("/opt/cathook/data/items_game.txt", "r");
if (!file || ferror(file) != 0) if (!file || ferror(file) != 0)