From a9903ac922d169e254c26931119c83ab69a709c9 Mon Sep 17 00:00:00 2001 From: Silent Date: Wed, 25 Sep 2019 20:36:39 +0200 Subject: [PATCH] Migrated Blista car crusher fix to use patterns and allowed it to fail gracefully --- SilentPatchIII/SilentPatchIII.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/SilentPatchIII/SilentPatchIII.cpp b/SilentPatchIII/SilentPatchIII.cpp index 8600a05..41778da 100644 --- a/SilentPatchIII/SilentPatchIII.cpp +++ b/SilentPatchIII/SilentPatchIII.cpp @@ -489,6 +489,9 @@ namespace AudioInitializedFix void InjectDelayedPatches_III_Common( bool bHasDebugMenu, const wchar_t* wcModulePath ) { + using namespace Memory; + using namespace hook; + // Locale based metric/imperial system INI/debug menu { using namespace Localization; @@ -501,6 +504,16 @@ void InjectDelayedPatches_III_Common( bool bHasDebugMenu, const wchar_t* wcModul DebugMenuEntrySetWrap(e, true); } } + + // Make crane be unable to lift Coach instead of Blista + { + // There is a possible incompatibility with limit adjusters, so patch it in a delayed hook point and gracefully handle failure + auto canPickBlista = pattern( "83 FA 66 74" ).count_hint(1); + if ( canPickBlista.size() == 1 ) + { + Patch( canPickBlista.get_first( 2 ), 127 ); // coach + } + } } void InjectDelayedPatches_III_Common() @@ -545,8 +558,6 @@ void Patch_III_10(const RECT& desktop) Patch(0x479C9A, 16); Patch(0x4FAD35, 16); - Patch(0x544AA4, 127); - Patch(0x5382BF, 0x0EEB); InjectHook(0x5382EC, HeadlightsFix, PATCH_JUMP); @@ -692,8 +703,6 @@ void Patch_III_11(const RECT& desktop) Patch(0x479C9A, 16); Patch(0x4FAE15, 16); - Patch(0x544CE4, 127); - Patch(0x5384FF, 0x0EEB); InjectHook(0x53852C, HeadlightsFix, PATCH_JUMP); @@ -818,8 +827,6 @@ void Patch_III_Steam(const RECT& desktop) Patch(0x479C9A, 16); Patch(0x4FADA5, 16); - Patch(0x544C94, 127); - InjectHook(0x4A58F0, ShowRadarTrace, PATCH_JUMP); InjectHook(0x4209A7, SetScaleProperly); InjectHook(0x420A1F, SetScaleProperly);