diff --git a/red4ext/EdgeWeightGPS/src/Main.cpp b/red4ext/EdgeWeightGPS/src/Main.cpp index eeb3d4a..b80dafd 100644 --- a/red4ext/EdgeWeightGPS/src/Main.cpp +++ b/red4ext/EdgeWeightGPS/src/Main.cpp @@ -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 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(&DetourGpsRouteJobBuild), reinterpret_cast(&gOriginalGpsRouteJobBuild)); - AttachProbeHook("GPSRouteProducer 0x44cc7c", kGpsRouteProducerRva, - reinterpret_cast(&DetourGpsRouteProducer), - reinterpret_cast(&gOriginalGpsRouteProducer)); - AttachProbeHook("GPSSearch 0x44f054", kGpsSearchRva, reinterpret_cast(&DetourGpsSearch), - reinterpret_cast(&gOriginalGpsSearch)); - AttachProbeHook("GPSEdgeCost 0x44f838", kGpsEdgeCostRva, reinterpret_cast(&DetourGpsEdgeCost), - reinterpret_cast(&gOriginalGpsEdgeCost)); + if (kEnableGpsLocalSearchHooks) + { + AttachProbeHook("GPSRouteProducer 0x44cc7c", kGpsRouteProducerRva, + reinterpret_cast(&DetourGpsRouteProducer), + reinterpret_cast(&gOriginalGpsRouteProducer)); + AttachProbeHook("GPSSearch 0x44f054", kGpsSearchRva, reinterpret_cast(&DetourGpsSearch), + reinterpret_cast(&gOriginalGpsSearch)); + AttachProbeHook("GPSEdgeCost 0x44f838", kGpsEdgeCostRva, reinterpret_cast(&DetourGpsEdgeCost), + reinterpret_cast(&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);