fix(cache): less peds on init (#1268)

This commit is contained in:
Aure7138
2023-04-19 16:57:49 +08:00
committed by GitHub
parent 1241f9835f
commit 10d0563c4a
4 changed files with 11 additions and 14 deletions

View File

@ -30,9 +30,9 @@ namespace big
}
gta_data_service::gta_data_service() :
m_peds_cache(g_file_manager->get_project_file("./cache/peds.bin"), 3),
m_vehicles_cache(g_file_manager->get_project_file("./cache/vehicles.bin"), 2),
m_weapons_cache(g_file_manager->get_project_file("./cache/weapons.bin"), 3),
m_peds_cache(g_file_manager->get_project_file("./cache/peds.bin"), 4),
m_vehicles_cache(g_file_manager->get_project_file("./cache/vehicles.bin"), 3),
m_weapons_cache(g_file_manager->get_project_file("./cache/weapons.bin"), 4),
m_update_state(eGtaDataUpdateState::IDLE)
{
if (!is_cache_up_to_date())

View File

@ -6,9 +6,10 @@
namespace big
{
yim_fipackfile::yim_fipackfile(rage::fiPackfile* rpf)
yim_fipackfile::yim_fipackfile(rage::fiPackfile* rpf, const std::string& mount_name)
{
this->rpf = rpf;
this->mount_name = mount_name;
}
void yim_fipackfile::add_wrapper_call_back(std::function<size_t(yim_fipackfile& rpf_wrapper)> cb)
@ -18,7 +19,7 @@ namespace big
void yim_fipackfile::for_each_fipackfile()
{
for (int i = 0; i < 3672; i++)
for (int i = 1; i < 3672; i++) // fipackfile ctor start with 1
{
auto* rpf = g_pointers->m_gta.m_fipackfile_instances[i];
@ -37,7 +38,7 @@ namespace big
{
std::vector<std::filesystem::path> file_paths;
if (parent.empty())
parent = "/";
parent = mount_name;
std::vector<std::string> directories;

View File

@ -8,11 +8,10 @@ namespace big
class yim_fipackfile
{
rage::fiPackfile* rpf;
std::string mount_name;
public:
explicit yim_fipackfile(rage::fiPackfile* rpf);
static std::vector<std::string> get_non_dlc_mounted_devices_names();
explicit yim_fipackfile(rage::fiPackfile* rpf, const std::string& mount_name = "/");
static inline std::vector<std::function<size_t(yim_fipackfile& rpf_wrapper)>> m_wrapper_call_back;