diff --git a/source/extrainfo.ixx b/source/extrainfo.ixx index dc7c497..7eb0c77 100644 --- a/source/extrainfo.ixx +++ b/source/extrainfo.ixx @@ -16,7 +16,7 @@ public: { CIniReader iniReader(""); - auto bExraInfo = iniReader.ReadInteger("MISC", "ExraInfo", 1) != 0; + auto bExraInfo = iniReader.ReadInteger("MISC", "ExtraInfo", 1) != 0; if (bExraInfo) { @@ -29,23 +29,26 @@ public: { static std::wstring extra = L""; regs.eax += 0x78; - auto s = std::wstring_view((wchar_t*)regs.eax); - auto imgNum = 0; - auto imgArrSize = 0; - for (auto& it : *pCGameConfigReader__ms_imgFiles) + if (pCGameConfigReader__ms_imgFiles) { - if (it.m_hFile != -1) - imgNum++; - imgArrSize++; + auto s = std::wstring_view((wchar_t*)regs.eax); + auto imgNum = 0; + auto imgArrSize = 0; + for (auto& it : *pCGameConfigReader__ms_imgFiles) + { + if (it.m_hFile != -1) + imgNum++; + imgArrSize++; + } + extra = s; + extra += L"~n~"; + extra += L" "; + extra += L"IMG Files: " + std::to_wstring(imgNum) + L" / " + std::to_wstring(imgArrSize); + if (imgNum >= imgArrSize) extra += L"; WARNING: IMG Files limit reached!"; + + regs.eax = (uintptr_t)extra.c_str(); } - extra = s; - extra += L"~n~"; - extra += L" "; - extra += L"IMG Files: " + std::to_wstring(imgNum) + L" / " + std::to_wstring(imgArrSize); - if (imgNum >= imgArrSize) extra += L"; WARNING: IMG Files limit reached!"; - - regs.eax = (uintptr_t)extra.c_str(); } }; injector::MakeInline2(pattern.get_first(0)); }