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( project(
ArtifactTracker ArtifactTracker
VERSION 1.0.6 VERSION 1.0.7
DESCRIPTION "Artifact Tracker" DESCRIPTION "Artifact Tracker"
LANGUAGES CXX) LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD 23)

View File

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

View File

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

View File

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