1
Fork 0

Create cell storage in a task, fixes CTD when accessing a created container from another thread

ae-1.6.629
Eddoursul 2 years ago
parent 4a1218782f
commit 7918a84386
  1. BIN
      Artifact Tracker.esp
  2. BIN
      SKSE/Plugins/ArtifactTracker.dll
  3. 5
      Source/ArtifactTrackerDLL/src/ArtifactTracker.cpp

Binary file not shown.

Binary file not shown.

@ -375,6 +375,7 @@ namespace ArtifactTracker
log::info("Adding new storage in {}", cell->GetName());
#endif
SKSE::GetTaskInterface()->AddTask([&]() {
cellStorage = RE::PlayerCharacter::GetSingleton()->PlaceObjectAtMe(g_cellContainer, true).get();
if (cellStorage) {
@ -382,14 +383,12 @@ namespace ArtifactTracker
g_persistentStorage->AddForm(cellStorage);
g_persistentMap[cellStorage->formID] = cellStorage;
ToggleHomeMode(cellStorage);
std::thread([]() {
std::this_thread::sleep_for(std::chrono::milliseconds(500));
SyncCellStorage();
}).detach();
} else {
log::error("Failed to create cell storage in OnCellEnter");
ToggleHomeMode(nullptr);
}
});
}
void SyncCellStorage(const RE::TESObjectREFR* a_ignoreRef)

Loading…
Cancel
Save