epic fixes

epic style
This commit is contained in:
LightCat 2018-09-08 20:28:15 +02:00
parent 6941019121
commit 1923f8bcf6
2 changed files with 22 additions and 4 deletions

View File

@ -21,10 +21,17 @@ int *g_PredictionRandomSeed = nullptr;
namespace criticals namespace criticals
{ {
CatCommand test("crit_debug_print", "debug", []() { CatCommand test("crit_debug_print", "debug", []() {
bool test = (*((uint8_t *) RAW_ENT(LOCAL_E) + 9645) & 2) / 2; if (CE_BAD(LOCAL_E))
int test2 = (*((uint8_t *) RAW_ENT(LOCAL_E) + 9645) & 2); return;
int test3 = (*((unsigned *) RAW_ENT(LOCAL_E) + 9645)); if (CE_BAD(LOCAL_W))
logging::Info("%d, %d, %d", test, test2, test3); 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) int find_next_random_crit_for_weapon(IClientEntity *weapon)
{ {

View File

@ -240,6 +240,8 @@ void smart_crouch()
if (*always_crouch) if (*always_crouch)
{ {
current_user_cmd->buttons |= IN_DUCK; current_user_cmd->buttons |= IN_DUCK;
if (crouchcdr.test_and_set(10000))
current_user_cmd->buttons &= ~IN_DUCK;
return; return;
} }
bool foundtar = false; bool foundtar = false;
@ -286,6 +288,15 @@ void smart_crouch()
// TODO: add more stuffs // TODO: add more stuffs
void CreateMove() void CreateMove()
{ {
if (!enable)
return;
if (g_Settings.bInvalid)
return;
if (CE_BAD(LOCAL_E))
return;
if (auto_crouch) if (auto_crouch)
smart_crouch(); smart_crouch();
} }