1

Initialize on kDataLoaded even when KID is not installed

This commit is contained in:
Eddoursul 2022-07-14 00:13:00 +02:00
parent 9fe55a34b7
commit be249e6ab9
2 changed files with 6 additions and 4 deletions

Binary file not shown.

View File

@ -29,11 +29,13 @@ namespace {
{
GetMessagingInterface()->RegisterListener([](MessagingInterface::Message* message) {
if (message->type == MessagingInterface::kPostLoad) {
SKSE::GetModCallbackEventSource()->AddEventSink(EventListener::GetSingleton());
} else if (message->type == MessagingInterface::kNewGame || message->type == MessagingInterface::kPreLoadGame) {
ArtifactTracker::Init(); // if KID is not installed
SKSE::GetModCallbackEventSource()->AddEventSink(EventListener::GetSingleton()); // runs, if KID is installed
} else if (message->type == MessagingInterface::kDataLoaded) {
if (const auto pluginInfo = ArtifactTracker::g_loadInterface->GetPluginInfo("po3_KeywordItemDistributor"); !pluginInfo) {
ArtifactTracker::Init(); // if KID is not installed
}
} else if (message->type == MessagingInterface::kPostLoadGame) {
ArtifactTracker::OnGameLoad(); // refresh g_persistentMap from savegame
ArtifactTracker::OnGameLoad(); // save-specific updates
}
});
}