1

Fixed crash when loading a save with missing plugins

This commit is contained in:
Eddoursul 2022-09-22 12:28:24 +02:00
parent ae35ac9fbb
commit 654067f863
5 changed files with 17 additions and 14 deletions

Binary file not shown.

View File

@ -6,7 +6,7 @@ message("Using toolchain file ${CMAKE_TOOLCHAIN_FILE}.")
########################################################################################################################
project(
ArtifactTracker
VERSION 1.0.6
VERSION 1.0.7
DESCRIPTION "Artifact Tracker"
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)

View File

@ -65,11 +65,12 @@ auto EventListener::ProcessEvent(
RE::BSTEventSource<RE::TESCellFullyLoadedEvent>* a_eventSource)
-> RE::BSEventNotifyControl
{
#ifdef _DEBUG
SKSE::log::info("TESCellFullyLoadedEvent");
#endif
ArtifactTracker::OnCellEnter(a_event->cell->GetLocation(), a_event->cell);
if (a_event->cell) {
#ifdef _DEBUG
SKSE::log::info("TESCellFullyLoadedEvent");
#endif
ArtifactTracker::OnCellEnter(a_event->cell->GetLocation(), a_event->cell);
}
return RE::BSEventNotifyControl::kContinue;
}

View File

@ -38,13 +38,15 @@ namespace {
}
} else if (message->type == MessagingInterface::kPreLoadGame) {
ArtifactTracker::g_bSaveLoaded = false; // block cell load events
} else if (message->type == MessagingInterface::kPostLoadGame) {
SKSE::GetTaskInterface()->AddTask([]() {
ArtifactTracker::OnGameLoad(); // save-specific updates
ArtifactTracker::g_bSaveLoaded = true;
const auto cell = RE::PlayerCharacter::GetSingleton()->GetParentCell();
ArtifactTracker::OnCellEnter(cell->GetLocation(), cell);
});
} else if (message->type == MessagingInterface::kPostLoadGame && message->data) {
const auto cell = RE::PlayerCharacter::GetSingleton()->GetParentCell();
if (cell) {
SKSE::GetTaskInterface()->AddTask([cell]() {
ArtifactTracker::OnGameLoad(); // save-specific updates
ArtifactTracker::g_bSaveLoaded = true;
ArtifactTracker::OnCellEnter(cell->GetLocation(), cell);
});
}
}
});
}

View File

@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
"name": "artifact-tracker",
"version-string": "1.0.6",
"version-string": "1.0.7",
"port-version": 0,
"description": "Artifact Tracker",
"homepage": "https://eddoursul.win/mods/artifact-tracker/",