mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-29 15:23:02 +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" },
|
{ "transmission_r", "transmision_r" },
|
||||||
{ "wheel_lm_dummy", "wheel_lm" },
|
{ "wheel_lm_dummy", "wheel_lm" },
|
||||||
};
|
};
|
||||||
|
static int (*orgStrcasecmp)(const char*, const char*);
|
||||||
int strcasecmp( const char* dataName, const char* nodeName )
|
int strcasecmp( const char* dataName, const char* nodeName )
|
||||||
{
|
{
|
||||||
/*assert( std::is_sorted(std::begin(typosAndFixes), std::end(typosAndFixes), [] (const auto& a, const auto& b) {
|
/*assert( std::is_sorted(std::begin(typosAndFixes), std::end(typosAndFixes), [] (const auto& a, const auto& b) {
|
||||||
return _stricmp( a.second, b.second ) < 0;
|
return _stricmp( a.second, b.second ) < 0;
|
||||||
}) );*/
|
}) );*/
|
||||||
|
|
||||||
const int origComp = _stricmp( dataName, nodeName );
|
const int origComp = orgStrcasecmp( dataName, nodeName );
|
||||||
if ( origComp == 0 ) return 0;
|
if ( origComp == 0 ) return 0;
|
||||||
|
|
||||||
for ( const auto& typo : typosAndFixes )
|
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
|
// 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
|
// Tug tow bar (misc_b instead of misc_a
|
||||||
|
|
Loading…
Reference in a new issue