Removed some checks on startup, moved the remaining to a task

This commit is contained in:
Eddoursul 2024-03-01 20:51:30 +01:00
parent d811231db0
commit 3df71a6bea
3 changed files with 31 additions and 786 deletions

View File

@ -666,445 +666,6 @@ inline void CheckSkyrimCells()
//memset(formids, 0, sizeof(formids)); //memset(formids, 0, sizeof(formids));
} }
inline void CheckEnderalCells()
{
// FormIDs of all Enderal cells.
uint32_t formids[415] = {
0x0014DB0F,
0x00114BBB,
0x00108AC3,
0x00106863,
0x000E67E3,
0x000DCBA3,
0x000A1E3B,
0x0008320B,
0x0006A8AF,
0x00050B67,
0x00043DEF,
0x0003E737,
0x000E4961,
0x00030F8D,
0x0014F6B7,
0x001080EB,
0x0008613B,
0x0010E671,
0x000ED971,
0x000EB581,
0x000C0E35,
0x00055DB5,
0x0012F42F,
0x000905FF,
0x00069C6B,
0x00012C3B,
0x000DABCD,
0x00081299,
0x0005C971,
0x0004D5B1,
0x000E2CAB,
0x0005530B,
0x000299C7,
0x0007F65B,
0x0007336F,
0x0005BCD3,
0x0013FB45,
0x0011C4DD,
0x000A5F1D,
0x00072B95,
0x00069C9D,
0x00149B58,
0x0012DAE8,
0x000E4960,
0x000B5264,
0x0009B710,
0x000ED97A,
0x000C0E3E,
0x0009FD56,
0x00024BCE,
0x000C0E34,
0x0008783C,
0x000528F8,
0x00033494,
0x00009900,
0x000EA95A,
0x000C566E,
0x0004145E,
0x00015282,
0x000FE108,
0x0007FBF0,
0x000098EC,
0x0011DC6A,
0x00102DF2,
0x00074AF2,
0x0005530A,
0x000299C6,
0x00010A84,
0x0014B5A2,
0x0007F65A,
0x0007336E,
0x0006C032,
0x00030FAA,
0x0012EF4C,
0x0011C4DC,
0x000A5F1C,
0x00096D50,
0x0004BC88,
0x00046ECC,
0x00130C29,
0x00070799,
0x00149B57,
0x000E495F,
0x000A5C4B,
0x00074547,
0x00004E77,
0x000ED979,
0x000C0E3D,
0x0009FD55,
0x00024BCD,
0x001461D7,
0x0008783B,
0x000528F7,
0x00033493,
0x000D9B6D,
0x000C566D,
0x0007FA69,
0x0004145D,
0x000375C5,
0x00032999,
0x000D8E1B,
0x000D89CF,
0x0006FECF,
0x001344F5,
0x00127E21,
0x0011DC69,
0x00102DF1,
0x000CBEA5,
0x00074AF1,
0x00033B19,
0x00000025,
0x0011847B,
0x0006E4F3,
0x000169D3,
0x00089B95,
0x000028B1,
0x000A5F1B,
0x00083213,
0x00069C9B,
0x00130C28,
0x000E495E,
0x0009B70E,
0x00147F2C,
0x00117890,
0x000ED978,
0x000C0E3C,
0x00055DBC,
0x00024BCC,
0x0008783A,
0x000250D6,
0x00127538,
0x000D9B6C,
0x000813CC,
0x00045A48,
0x00021634,
0x00014B78,
0x0011B1DE,
0x0006FECE,
0x000399AA,
0x000098EA,
0x00127E20,
0x0011DC68,
0x00102DF0,
0x000CBEA4,
0x000A5894,
0x00067288,
0x0011847A,
0x0006E4F2,
0x00089B94,
0x0007336C,
0x0004C26C,
0x00083212,
0x0003C4DE,
0x00128CCF,
0x000D340F,
0x000E495D,
0x000A82F5,
0x000405A1,
0x00147F2B,
0x0013D0F3,
0x000ED977,
0x000D24BF,
0x000C0E3B,
0x00055DBB,
0x0009710D,
0x00015671,
0x00098553,
0x000813CB,
0x0015295D,
0x0012AB15,
0x00085A75,
0x0006FECD,
0x000399A9,
0x000098E9,
0x00127E1F,
0x0011DC67,
0x000A5893,
0x000848D7,
0x0007075B,
0x00067287,
0x001130E1,
0x0010FF45,
0x0010A829,
0x000DD775,
0x000CEB85,
0x000CD6D1,
0x0006E4F1,
0x000DEDAF,
0x000A19FF,
0x00089B93,
0x0004C26B,
0x0002BA7F,
0x000BCB8D,
0x00083211,
0x0004B25D,
0x001503AA,
0x0013F5BE,
0x0013B612,
0x00128CCE,
0x000CAFA2,
0x000E495C,
0x0009B70C,
0x00020AFC,
0x0010D1C2,
0x000ED976,
0x000D24BE,
0x000C0E3A,
0x000AECC6,
0x00055DBA,
0x00009906,
0x001514BC,
0x0009855C,
0x0009710C,
0x00090988,
0x0006C768,
0x00036A14,
0x000098FC,
0x000E041A,
0x000D9B6A,
0x00082432,
0x0015295C,
0x0012AB14,
0x0010BBC4,
0x00085A74,
0x0006FECC,
0x000098E8,
0x0014E5BE,
0x00127E1E,
0x001152E6,
0x000848D6,
0x001130E0,
0x000CEB84,
0x0007D400,
0x00076E70,
0x0006E4F0,
0x000EFFE6,
0x000DEDAE,
0x000E1A2C,
0x000CC974,
0x000BCB8C,
0x00083210,
0x00128CCD,
0x00119B01,
0x000CAFA1,
0x000A9EB9,
0x00078625,
0x000E495B,
0x000DE74F,
0x000B525F,
0x0009B70B,
0x00020AFB,
0x0000990F,
0x00143B31,
0x0010D1C1,
0x000ED975,
0x000D74D1,
0x000D24BD,
0x000AECC5,
0x0008D791,
0x00055DB9,
0x00009905,
0x00133E07,
0x0011267B,
0x000C6677,
0x0009855B,
0x0009710B,
0x00090987,
0x00143479,
0x0011F9C5,
0x000D9B69,
0x0015295B,
0x00102947,
0x000C3913,
0x00089123,
0x00085A73,
0x0006FECB,
0x0013CA25,
0x00129141,
0x00127E1D,
0x000848D5,
0x00056A11,
0x0013CF2F,
0x001130DF,
0x000CEB83,
0x0008E957,
0x0007D3FF,
0x00079F43,
0x0006E4EF,
0x000DEDAD,
0x00086739,
0x000BCB8B,
0x0008320F,
0x00144954,
0x000A9EB8,
0x0007EB50,
0x0001CB58,
0x000E495A,
0x000DE74E,
0x000B525E,
0x00004382,
0x00143B30,
0x000ED974,
0x000D24BC,
0x000C0E38,
0x000AECC4,
0x0005A728,
0x00055DB8,
0x00022904,
0x00009904,
0x00133E06,
0x0012E492,
0x000C6676,
0x0009855A,
0x0009710A,
0x00069C6E,
0x00019C50,
0x0015295A,
0x0012AB12,
0x0006FECA,
0x000098E6,
0x000FF034,
0x000EB818,
0x000C91B4,
0x0009B228,
0x000848D4,
0x001130DE,
0x00100C4A,
0x000CEB82,
0x0007D3FE,
0x0006E4EE,
0x0001A01A,
0x0011F744,
0x000DEDAC,
0x00086738,
0x0007BC20,
0x000ACECE,
0x0008320E,
0x00081CF6,
0x00048F32,
0x0003E73A,
0x00011046,
0x000A9EB7,
0x000780AB,
0x000E4959,
0x000B525D,
0x00045101,
0x001461DB,
0x00107EEF,
0x000ED973,
0x000C0E37,
0x000AECC3,
0x0005A727,
0x00055DB7,
0x00034D97,
0x00009903,
0x001514B9,
0x0012E491,
0x00103F39,
0x000C5671,
0x0005AE7F,
0x000A2635,
0x0006FEC9,
0x0003D825,
0x000FF033,
0x000EB817,
0x0009B227,
0x001315A1,
0x00127515,
0x001130DD,
0x00100C49,
0x000DD771,
0x000A51E1,
0x0007A7D9,
0x0012511B,
0x0011C4DF,
0x000F524F,
0x000DEDAB,
0x000ACECD,
0x0008320D,
0x00081CF5,
0x00048F31,
0x0003E739,
0x0013584E,
0x00030F8E,
0x0013EB88,
0x000E77D4,
0x000E4958,
0x0012A552,
0x0010E672,
0x000C0E36,
0x0007284E,
0x001514B8,
0x00136C80,
0x0012E490,
0x000C5670,
0x001421B6,
0x000E040C,
0x00098D14,
0x0005530C,
0x00043A94,
0x000FF032,
0x0009B226,
0x001130DC,
0x000A51E0,
0x0008AD90,
0x0013FB46,
0x001346CE,
0x0011C4DE,
0x000DEDAA,
0x0007B89A,
0x00130C2C,
0x00106864,
0x000DCBA4,
0x000A1E3C,
0x0008320C
};
for (int i = 0; i < 415; i++) {
const auto* form = RE::TESForm::LookupByID(formids[i]);
if (!form) {
if (!bMessageShown) {
bMessageShown = true;
RE::DebugMessageBox("Some of the installed mods are incompatible with Enderal.\nCheck console for the list of flagged mods.");
}
} else if (!form->Is(RE::FormType::Cell)) {
logger::warn("Detected invalid cell: {:08X}", formids[i]);
NotifyInvalidForm(form);
}
}
//memset(formids, 0, sizeof(formids));
aModNames.clear();
}
inline void CheckCCMods() inline void CheckCCMods()
{ {
std::string filenames[74] = { std::string filenames[74] = {
@ -1214,315 +775,3 @@ inline void CheckUnconvertedMap()
} }
} }
} }
inline void CheckEnderalContainers()
{
// Base forms of Enderal containers, having collisions with Skyrim
uint32_t formids[13] = {
0x17234,
0x3661E,
0x43BF2,
0x4602B,
0x469E6,
0x46AEF,
0x46D85,
0x56161,
0x56165,
0x7BC22,
0x967AA,
0xF85F4,
0x108AA7
};
for (int i = 0; i < 13; i++) {
const auto* form = RE::TESForm::LookupByID(formids[i]);
if (!form || !form->Is(RE::FormType::Container)) {
logger::warn("Detected invalid container: {:08X}", formids[i]);
NotifyInvalidForm(form);
}
}
}
inline void CheckEnderalNPCs()
{
// Base forms of Enderal actors, having collisions with Skyrim
uint32_t formids[55] = {
0x1722B,
0x1723A,
0x1A4E0,
0x22FA4,
0x22FA6,
0x23133,
0x2320C,
0x25D20,
0x2A006,
0x3280A,
0x365F6,
0x36613,
0x366F0,
0x3675D,
0x39F58,
0x3C599,
0x447BE,
0x447F3,
0x469E2,
0x469E3,
0x469E4,
0x46AF6,
0x46AF7,
0x46D83,
0x46D84,
0x46DFB,
0x46EE4,
0x46EF1,
0x46EF2,
0x46EF3,
0x4838F,
0x7265B,
0x7265E,
0x72660,
0x92A62,
0x92A64,
0x954D9,
0x967F9,
0xA8608,
0xA860B,
0xA8614,
0xA861E,
0xA9623,
0xBED8B,
0xCC95C,
0xDD714,
0xE48FA,
0xEA717,
0xEA71A,
0x103269,
0x1032B9,
0x1032C7,
0x1032CB,
0x1032CC,
0x1033FE
};
for (int i = 0; i < 55; i++) {
const auto* form = RE::TESForm::LookupByID(formids[i]);
if (!form || !form->Is(RE::FormType::NPC)) {
logger::warn("Detected invalid actor: {:08X}", formids[i]);
NotifyInvalidForm(form);
}
}
}
inline void CheckEnderalActivators()
{
// Base forms of Enderal activators, having collisions with Skyrim
uint32_t formids[46] = {
0x20A1C,
0x23AB1,
0x36739,
0x3BCA5,
0x3BCB3,
0x3C570,
0x3C57F,
0x43BEB,
0x43BEE,
0x447D3,
0x469F6,
0x469F8,
0x469FA,
0x469FC,
0x46ADE,
0x46AEA,
0x69F89,
0x69F8C,
0x6A00D,
0x6A00E,
0x6A00F,
0x6A010,
0x6A011,
0x6A013,
0x6A016,
0x6A024,
0x6A025,
0x6A026,
0x6A027,
0x6A029,
0x6A02A,
0x6A02B,
0x6A02C,
0x6A02D,
0x6A02E,
0x6A030,
0x6A032,
0x6A033,
0x77358,
0xADC71,
0xB35AB,
0xB35B4,
0xB35B5,
0xB6282,
0x106644,
0x1080DA
};
for (int i = 0; i < 46; i++) {
const auto* form = RE::TESForm::LookupByID(formids[i]);
if (!form || !form->Is(RE::FormType::Activator)) {
logger::warn("Detected invalid activator: {:08X}", formids[i]);
NotifyInvalidForm(form);
}
}
}
inline void CheckEnderalStatics()
{
// Base forms of Enderal statics, having collisions with Skyrim
uint32_t formids[138] = {
0x15C6F,
0x1725C,
0x20BC9,
0x20BDF,
0x23E46,
0x2E6F8,
0x2EC26,
0x2EE3F,
0x31949,
0x3194B,
0x3195B,
0x31974,
0x327AD,
0x328D7,
0x33F45,
0x34944,
0x34946,
0x34BCD,
0x36747,
0x36775,
0x36779,
0x3700B,
0x3742A,
0x37667,
0x37668,
0x37C01,
0x3A1C2,
0x3BCE3,
0x3BCE7,
0x3C58A,
0x3ECAA,
0x41449,
0x4B258,
0x4B25A,
0x565F0,
0x6717B,
0x6717C,
0x6717D,
0x69524,
0x69525,
0x69526,
0x69527,
0x6A034,
0x6A035,
0x6A036,
0x6A037,
0x6A038,
0x6A039,
0x6A03A,
0x6A03B,
0x6A03C,
0x6A03D,
0x6A03E,
0x6A03F,
0x6A040,
0x6A041,
0x6A042,
0x6A045,
0x6A046,
0x6A047,
0x6A048,
0x6A049,
0x6A04A,
0x6A04B,
0x6A04C,
0x6A04D,
0x6A04F,
0x6A050,
0x6A051,
0x6A052,
0x6A053,
0x6A054,
0x6A057,
0x6A058,
0x6A059,
0x6A05A,
0x6A094,
0x6D230,
0x6D233,
0x6D235,
0x6D23F,
0x6D24D,
0x6D253,
0x6D257,
0x6FEEA,
0x6FEED,
0x6FEEE,
0x6FEEF,
0x6FEF0,
0x6FEF1,
0x6FEF2,
0x6FEF3,
0x6FEF4,
0x6FEF5,
0x6FEF6,
0x6FEF7,
0x6FEF8,
0x6FEF9,
0x6FEFA,
0x6FEFD,
0x904B1,
0x904B2,
0x904B3,
0x904B4,
0x904B5,
0x904B6,
0x904B7,
0x904B8,
0x904B9,
0x904BA,
0x904BB,
0x904BC,
0x904BD,
0x904BE,
0x904BF,
0x904C0,
0xDAAF3,
0xDAAF5,
0xDAAF8,
0xDAAFC,
0xDAAFE,
0xDAB01,
0xE49F3,
0xE4A12,
0xE77BF,
0xE77C0,
0xE77C1,
0xE77C2,
0xE77C3,
0xE77C4,
0xE77C5,
0xE77C6,
0xE77C7,
0xE77C8,
0xE77C9,
0xE77CA,
0xE77CB,
0xE77CF
};
for (int i = 0; i < 138; i++) {
const auto* form = RE::TESForm::LookupByID(formids[i]);
if (!form || !form->Is(RE::FormType::Static)) {
logger::warn("Detected invalid static: {:08X}", formids[i]);
NotifyInvalidForm(form);
}
}
}

View File

@ -87,45 +87,46 @@ namespace {
} }
} }
const auto dataHandler = RE::TESDataHandler::GetSingleton(); SKSE::GetTaskInterface()->AddTask([]() {
if (dataHandler) { const auto dataHandler = RE::TESDataHandler::GetSingleton();
if (!dataHandler->LookupLoadedModByName("Update.esm")) { if (dataHandler) {
MessageBoxW(NULL, L"Update.esm is not loaded!", L"Enderal SE Error", MB_OK | MB_ICONERROR); if (!dataHandler->LookupLoadedModByName("Update.esm")) {
exit(EXIT_FAILURE); MessageBoxW(NULL, L"Update.esm is not loaded!", L"Enderal SE Error", MB_OK | MB_ICONERROR);
exit(EXIT_FAILURE);
}
if (!dataHandler->LookupLoadedModByName("Enderal - Forgotten Stories.esm")) {
MessageBoxW(NULL, L"Enderal - Forgotten Stories.esm is not loaded!", L"Enderal SE Error", MB_OK | MB_ICONERROR);
exit(EXIT_FAILURE);
}
} }
if (!dataHandler->LookupLoadedModByName("Enderal - Forgotten Stories.esm")) {
MessageBoxW(NULL, L"Enderal - Forgotten Stories.esm is not loaded!", L"Enderal SE Error", MB_OK | MB_ICONERROR); bool bScripts = RE::BSScript::Internal::VirtualMachine::GetSingleton()->TypeIsValid("PRKF__00E_CraftQuestPotionPe_0300146D");
exit(EXIT_FAILURE); bool bInterface = RE::BSResourceNiBinaryStream("interface/00e_heromenu.swf").good();
if (!bScripts || !bInterface) {
RE::DebugMessageBox("E - Misc.bsa is not loaded or is outdated. Make sure Enderal - Forgotten Stories.esm is enabled and revalidate your files.");
} }
}
bool bScripts = RE::BSScript::Internal::VirtualMachine::GetSingleton()->TypeIsValid("PRKF__00E_CraftQuestPotionPe_0300146D"); bool bSounds = RE::BSResourceNiBinaryStream("sound/fx/enderal/laughingchild.wav").good();
bool bInterface = RE::BSResourceNiBinaryStream("interface/00e_heromenu.swf").good();
if (!bScripts || !bInterface) { if (!bSounds) {
RE::DebugMessageBox("E - Misc.bsa is not loaded or is outdated. Make sure Enderal - Forgotten Stories.esm is enabled and revalidate your files."); RE::DebugMessageBox("E - Sounds.bsa is not loaded. Make sure Enderal - Forgotten Stories.esm is enabled and revalidate your files.");
} }
bool bSounds = RE::BSResourceNiBinaryStream("sound/fx/enderal/laughingchild.wav").good(); bool bVoices = RE::BSResourceNiBinaryStream("sound/voice/enderal - forgotten stories.esm/vt_calia/fs_mq18c__0002a4ed_1.fuz").good();
if (!bSounds) { if (!bVoices) {
RE::DebugMessageBox("E - Sounds.bsa is not loaded. Make sure Enderal - Forgotten Stories.esm is enabled and revalidate your files."); RE::DebugMessageBox("L - Voices.bsa is not loaded. Make sure Enderal - Forgotten Stories.esm is enabled and revalidate your files.");
} }
bool bVoices = RE::BSResourceNiBinaryStream("sound/voice/enderal - forgotten stories.esm/vt_calia/fs_mq18c__0002a4ed_1.fuz").good(); bool bMeshes = RE::BSResourceNiBinaryStream("meshes/enderal/loadscreenart/loadscreenundercity.nif").good();
if (!bVoices) { if (!bMeshes) {
RE::DebugMessageBox("L - Voices.bsa is not loaded. Make sure Enderal - Forgotten Stories.esm is enabled and revalidate your files."); RE::DebugMessageBox("E - Meshes.bsa is not loaded. Make sure Enderal - Forgotten Stories.esm is enabled and revalidate your files.");
} }
bool bMeshes = RE::BSResourceNiBinaryStream("meshes/enderal/loadscreenart/loadscreenundercity.nif").good();
if (!bMeshes) {
RE::DebugMessageBox("E - Meshes.bsa is not loaded. Make sure Enderal - Forgotten Stories.esm is enabled and revalidate your files.");
}
CheckIncompatibleMods();
CheckIncompatibleMods();
});
} else if ((message->type == MessagingInterface::kPostLoadGame && message->data) || message->type == MessagingInterface::kNewGame) { } else if ((message->type == MessagingInterface::kPostLoadGame && message->data) || message->type == MessagingInterface::kNewGame) {
NewGameCount(true); NewGameCount(true);
} }

View File

@ -51,11 +51,6 @@ inline void CheckIncompatibleMods()
CheckWorldspaces(); CheckWorldspaces();
CheckUnconvertedMap(); CheckUnconvertedMap();
CheckSkyrimCells(); CheckSkyrimCells();
CheckEnderalCells();
CheckEnderalContainers();
CheckEnderalNPCs();
CheckEnderalActivators();
CheckEnderalStatics();
} }
inline bool PapyrusGlobalFunctionExists(const char* scriptName, const char* funcName) inline bool PapyrusGlobalFunctionExists(const char* scriptName, const char* funcName)