mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-28 06:43:01 +05:00
Pre-emptively make HierarchyTypoFix more compatible with mods
This commit is contained in:
parent
82fba227af
commit
095ed65476
1 changed files with 7 additions and 2 deletions
|
@ -1592,13 +1592,14 @@ namespace HierarchyTypoFix
|
|||
{ "transmission_r", "transmision_r" },
|
||||
{ "wheel_lm_dummy", "wheel_lm" },
|
||||
};
|
||||
static int (*orgStrcasecmp)(const char*, const char*);
|
||||
int strcasecmp( const char* dataName, const char* nodeName )
|
||||
{
|
||||
/*assert( std::is_sorted(std::begin(typosAndFixes), std::end(typosAndFixes), [] (const auto& a, const auto& b) {
|
||||
return _stricmp( a.second, b.second ) < 0;
|
||||
}) );*/
|
||||
|
||||
const int origComp = _stricmp( dataName, nodeName );
|
||||
const int origComp = orgStrcasecmp( dataName, nodeName );
|
||||
if ( origComp == 0 ) return 0;
|
||||
|
||||
for ( const auto& typo : typosAndFixes )
|
||||
|
@ -4969,7 +4970,11 @@ void Patch_SA_10(HINSTANCE hInstance)
|
|||
|
||||
|
||||
// DFT-30 wheel, Sweeper brushes and other typos in hierarchy
|
||||
InjectHook( 0x4C5311, HierarchyTypoFix::strcasecmp );
|
||||
{
|
||||
using namespace HierarchyTypoFix;
|
||||
|
||||
InterceptCall(0x4C5311, orgStrcasecmp, strcasecmp);
|
||||
}
|
||||
|
||||
|
||||
// Tug tow bar (misc_b instead of misc_a
|
||||
|
|
Loading…
Reference in a new issue