Tune GPS cost table patch
This commit is contained in:
@@ -97,6 +97,7 @@ constexpr bool kEnableVerboseRouteObserverHooks = false;
|
||||
constexpr bool kEnableVerboseMappinRouteState = false;
|
||||
constexpr bool kEnableGpsMultiplierHooks = false;
|
||||
constexpr bool kEnableGpsCostTablePatch = true;
|
||||
constexpr bool kEnableGpsLocalSearchHooks = false;
|
||||
constexpr uintptr_t kGpsSystemTickRva = 0x0E6B62C;
|
||||
constexpr uintptr_t kJournalTrackEntryImplRva = 0x05944FC;
|
||||
constexpr uintptr_t kJournalListenerArrayOffset = 0x210;
|
||||
@@ -165,7 +166,7 @@ constexpr uintptr_t kGpsAuxMultiplierRva = 0x040BB00;
|
||||
constexpr uintptr_t kGpsNodeMultiplierRva = 0x040BB40;
|
||||
constexpr uintptr_t kGpsCostMultiplierTableRva = 0x3154D28;
|
||||
constexpr std::array<float, 7> kGpsPatchedCostMultipliers = {
|
||||
25.0f, 18.0f, 8.0f, 0.0f, 0.35f, 0.50f, 0.75f,
|
||||
12.0f, 7.0f, 2.5f, 0.0f, 3.0f, 2.0f, 1.25f,
|
||||
};
|
||||
|
||||
HMODULE gModule = nullptr;
|
||||
@@ -4062,13 +4063,16 @@ RED4EXT_C_EXPORT bool RED4EXT_CALL Main(RED4ext::v1::PluginHandle aHandle, RED4e
|
||||
AttachProbeHook("GPSRouteJobBuild 0x818ba8", kGpsRouteJobBuildRva,
|
||||
reinterpret_cast<void*>(&DetourGpsRouteJobBuild),
|
||||
reinterpret_cast<void**>(&gOriginalGpsRouteJobBuild));
|
||||
AttachProbeHook("GPSRouteProducer 0x44cc7c", kGpsRouteProducerRva,
|
||||
reinterpret_cast<void*>(&DetourGpsRouteProducer),
|
||||
reinterpret_cast<void**>(&gOriginalGpsRouteProducer));
|
||||
AttachProbeHook("GPSSearch 0x44f054", kGpsSearchRva, reinterpret_cast<void*>(&DetourGpsSearch),
|
||||
reinterpret_cast<void**>(&gOriginalGpsSearch));
|
||||
AttachProbeHook("GPSEdgeCost 0x44f838", kGpsEdgeCostRva, reinterpret_cast<void*>(&DetourGpsEdgeCost),
|
||||
reinterpret_cast<void**>(&gOriginalGpsEdgeCost));
|
||||
if (kEnableGpsLocalSearchHooks)
|
||||
{
|
||||
AttachProbeHook("GPSRouteProducer 0x44cc7c", kGpsRouteProducerRva,
|
||||
reinterpret_cast<void*>(&DetourGpsRouteProducer),
|
||||
reinterpret_cast<void**>(&gOriginalGpsRouteProducer));
|
||||
AttachProbeHook("GPSSearch 0x44f054", kGpsSearchRva, reinterpret_cast<void*>(&DetourGpsSearch),
|
||||
reinterpret_cast<void**>(&gOriginalGpsSearch));
|
||||
AttachProbeHook("GPSEdgeCost 0x44f838", kGpsEdgeCostRva, reinterpret_cast<void*>(&DetourGpsEdgeCost),
|
||||
reinterpret_cast<void**>(&gOriginalGpsEdgeCost));
|
||||
}
|
||||
if (kEnableGpsMultiplierHooks)
|
||||
{
|
||||
AttachProbeHook("GPSAuxMultiplier 0x40bb00", kGpsAuxMultiplierRva,
|
||||
@@ -4197,9 +4201,12 @@ RED4EXT_C_EXPORT bool RED4EXT_CALL Main(RED4ext::v1::PluginHandle aHandle, RED4e
|
||||
DetachProbeHook("GPSQueryDispatch 0x70a570", kGpsQueryDispatchRva);
|
||||
DetachProbeHook("GPSQueryResultFetch 0x7094b8", kGpsQueryResultFetchRva);
|
||||
DetachProbeHook("GPSQueryStatus 0xaa5704", kGpsQueryStatusRva);
|
||||
DetachProbeHook("GPSRouteProducer 0x44cc7c", kGpsRouteProducerRva);
|
||||
DetachProbeHook("GPSSearch 0x44f054", kGpsSearchRva);
|
||||
DetachProbeHook("GPSEdgeCost 0x44f838", kGpsEdgeCostRva);
|
||||
if (kEnableGpsLocalSearchHooks)
|
||||
{
|
||||
DetachProbeHook("GPSRouteProducer 0x44cc7c", kGpsRouteProducerRva);
|
||||
DetachProbeHook("GPSSearch 0x44f054", kGpsSearchRva);
|
||||
DetachProbeHook("GPSEdgeCost 0x44f838", kGpsEdgeCostRva);
|
||||
}
|
||||
if (kEnableGpsMultiplierHooks)
|
||||
{
|
||||
DetachProbeHook("GPSAuxMultiplier 0x40bb00", kGpsAuxMultiplierRva);
|
||||
|
||||
Reference in New Issue
Block a user