Gameplay stuff

This commit is contained in:
Federico Cecchetto 2022-05-29 20:52:14 +02:00
parent 97653e72b2
commit f9c9edf88b

View File

@ -72,24 +72,24 @@ namespace gameplay
return utils::hook::assemble([](utils::hook::assembler& a)
{
const auto no_bounce = a.newLabel();
const auto loc_1401EAF9D = a.newLabel();
const auto loc_2D395D = a.newLabel();
a.push(rax);
a.mov(rax, qword_ptr(reinterpret_cast<int64_t>(&dvars::pm_bouncing)));
a.mov(al, byte_ptr(rax, 0x10));
a.cmp(al, 0);
a.cmp(byte_ptr(rbp, -0x7D), al);
a.pop(rax);
a.jz(no_bounce);
a.jmp(0x2D39C0_b);
a.bind(no_bounce);
a.cmp(dword_ptr(rsp, 0x70), 0);
a.jnz(loc_1401EAF9D);
a.cmp(dword_ptr(rsp, 0x44), 0);
a.jnz(loc_2D395D);
a.jmp(0x2D39B1_b);
a.bind(loc_1401EAF9D);
a.bind(loc_2D395D);
a.jmp(0x2D395D_b);
});
}
@ -184,7 +184,7 @@ namespace gameplay
game::DVAR_FLAG_REPLICATED, "Firing weapon will not decrease clip ammo");
pm_weapon_use_ammo_hook.create(0x2DF830_b, &pm_weapon_use_ammo_stub);
/*utils::hook::nop(0x4006AD_b, 15);
utils::hook::nop(0x4006AD_b, 15);
utils::hook::jump(0x4006AD_b, g_speed_stub(), true);
dvars::g_speed = dvars::register_int("g_speed", 190, 0, 1000,
game::DVAR_FLAG_REPLICATED, "changes the speed of the player");
@ -198,6 +198,7 @@ namespace gameplay
utils::hook::jump(0x3FF812_b, client_end_frame_stub(), true);
utils::hook::nop(0x3FF808_b, 1);
/*
// Influence PM_JitterPoint code flow so the trace->startsolid checks are 'ignored'
pm_player_trace_hook.create(0x2D14C0_b, &pm_player_trace_stub);
// If g_enableElevators is 1 the 'ducked' flag will always be removed from the player state