Disable dupe detector in freemode. (#3449)

* Fixed freemode detecting duplicate vehicles and trying to emit DUPE_DETECT metric.

* Added unlikely attribute to allow_all_vehicles_in_heists.
This commit is contained in:
gir489 2024-07-27 15:01:19 -04:00 committed by GitHub
parent 43afdae9e7
commit 665afb1bd5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 51 additions and 31 deletions

View File

@ -18,13 +18,11 @@ namespace big
{
if (auto tunable_ptr = g_tunables_service->get_tunable<PBOOL>(tunable_hash)) [[likely]]
{
if (*tunable_ptr != FALSE)
{
if (*tunable_ptr != FALSE) [[unlikely]]
*tunable_ptr = FALSE;
}
}
}
}
};
allvehsinheists g_allvehsinheists("allvehsinheists", "VEHICLE_ALLOW_ALL_IN_HEISTS", "VEHICLE_ALLOW_ALL_IN_HEISTS_DESC", g.vehicle.all_vehs_in_heists);

View File

@ -0,0 +1,22 @@
#include "backend/looped_command.hpp"
#include "services/tunables/tunables_service.hpp"
namespace big
{
class bypass_dupe_detector : looped_command
{
using looped_command::looped_command;
virtual void on_tick() override
{
if (auto tunable = g_tunables_service->get_tunable<PBOOL>("ENABLED_DOZER_DETECTOR"_J)) [[likely]]
{
if (*tunable == TRUE) [[unlikely]]
*tunable = FALSE;
}
}
};
bool always_on = true;
bypass_dupe_detector g_bypass_dupe_detector("dupedetector", "DUPE_DETECTOR", "", always_on);
}