feat: Fast Respawn, Rapid Fire, removed static offsets (#649)

Closes #495
Fixes #635
This commit is contained in:
Aure7138
2022-11-30 03:16:07 +08:00
committed by GitHub
parent a17aed317e
commit df1c459089
10 changed files with 67 additions and 73 deletions

View File

@ -1,6 +1,5 @@
#include "backend/looped/looped.hpp"
#include "util/misc.hpp"
#include "util/water.hpp"
namespace big
{
@ -25,12 +24,6 @@ namespace big
g_local_player->m_vehicle->m_deform_god = 0x9C;
}
float* water_collision_ptr = nullptr;
if (g_local_player->m_vehicle->m_navigation != nullptr)
{
water_collision_ptr = water::get_water_collision_ptr(g_local_player->m_vehicle->m_navigation);
}
uint32_t bits = g->vehicle.proof_mask;
uint32_t changed_bits = bits ^ last_bits;
uint32_t changed_or_enabled_bits = bits | changed_bits;
@ -40,25 +33,6 @@ namespace big
uint32_t unchanged_bits = g_local_player->m_vehicle->m_damage_bits & ~changed_or_enabled_bits;
g_local_player->m_vehicle->m_damage_bits = unchanged_bits | bits;
last_bits = bits;
if (changed_or_enabled_bits & (uint32_t)eEntityProofs::WATER)
{
water::reset_ped_oxygen_time(g_local_player);
if (water_collision_ptr != nullptr && *water_collision_ptr != 0.f)
{
last_water_collistion_strength = *water_collision_ptr;
*water_collision_ptr = 0;
}
return;
}
}
if (last_water_collistion_strength != 0 && water_collision_ptr != nullptr)
{
*water_collision_ptr = last_water_collistion_strength;
last_water_collistion_strength = 0;
}
}
}