[StructuredData] Reset empty classnames

This commit is contained in:
momo5502 2017-02-25 17:27:34 +01:00
parent 89ef10b789
commit 0d4934d163
3 changed files with 17 additions and 1 deletions

View File

@ -20,7 +20,7 @@ namespace Components
Console::FreeNativeConsole();
if (Loader::PerformingUnitTests() || Dedicated::IsEnabled() || ZoneBuilder::IsEnabled()) return;
if (Loader::PerformingUnitTests() || Dedicated::IsEnabled() || ZoneBuilder::IsEnabled() || Monitor::IsEnabled()) return;
Singleton::FirstInstance = (CreateMutexA(nullptr, FALSE, "iw4x_mutex") && GetLastError() != ERROR_ALREADY_EXISTS);

View File

@ -152,6 +152,17 @@ namespace Components
// 15 or more custom classes
Utils::Hook::Set<BYTE>(0x60A2FE, NUM_CUSTOM_CLASSES);
// Reset empty names
Command::Add("checkClasses", [](Command::Params*)
{
for (int i = 0; i < NUM_CUSTOM_CLASSES; ++i)
{
// TODO: Correctly lookup using structured data
char* className = (reinterpret_cast<char*>(0x1AD3694) - 4 + 3003 + (64 * i) + 0x29);
if (!*className) strcpy_s(className, 24, Game::SEH_StringEd_GetString(Utils::String::VA("CLASS_SLOT%i", i + 1)));
}
});
// Only execute this when building zones
if (!ZoneBuilder::IsEnabled()) return;

View File

@ -1560,6 +1560,11 @@ namespace Game
size_t size; // 8188
};
struct StructuredDataLookup
{
char pad[0x10];
};
typedef struct
{
StructuredDataDef* data;