diff --git a/src/crits.cpp b/src/crits.cpp index 7a98dac6..7d98af73 100644 --- a/src/crits.cpp +++ b/src/crits.cpp @@ -21,10 +21,17 @@ int *g_PredictionRandomSeed = nullptr; namespace criticals { CatCommand test("crit_debug_print", "debug", []() { - bool test = (*((uint8_t *) RAW_ENT(LOCAL_E) + 9645) & 2) / 2; - int test2 = (*((uint8_t *) RAW_ENT(LOCAL_E) + 9645) & 2); - int test3 = (*((unsigned *) RAW_ENT(LOCAL_E) + 9645)); - logging::Info("%d, %d, %d", test, test2, test3); + if (CE_BAD(LOCAL_E)) + return; + if (CE_BAD(LOCAL_W)) + return; + unsigned unk1 = *(unsigned *)(RAW_ENT(LOCAL_W) + 2832); + unsigned unk2 = *(unsigned *)(RAW_ENT(LOCAL_W) + 2820); + unsigned char CritSlots = *(unsigned char *)(unk1 + (unk2 << 6) + 1844); + int CritSlots2 = *(unsigned *)(unk1 + (unk2 << 6) + 1788); + unsigned CritSlots3 = *(unsigned *)(unk1 + (unk2 << 6) + 1788); + int CritSlots4 = *(int *)(unk1 + (unk2 << 6) + 1788); + logging::Info("%u %d %d %u %d", unk1, int(CritSlots), CritSlots2, CritSlots3, CritSlots4); }); int find_next_random_crit_for_weapon(IClientEntity *weapon) { diff --git a/src/hacks/CatBot.cpp b/src/hacks/CatBot.cpp index 5e41c0e0..ecb09763 100644 --- a/src/hacks/CatBot.cpp +++ b/src/hacks/CatBot.cpp @@ -240,6 +240,8 @@ void smart_crouch() if (*always_crouch) { current_user_cmd->buttons |= IN_DUCK; + if (crouchcdr.test_and_set(10000)) + current_user_cmd->buttons &= ~IN_DUCK; return; } bool foundtar = false; @@ -286,6 +288,15 @@ void smart_crouch() // TODO: add more stuffs void CreateMove() { + if (!enable) + return; + + if (g_Settings.bInvalid) + return; + + if (CE_BAD(LOCAL_E)) + return; + if (auto_crouch) smart_crouch(); }