#pragma once #include #include #include namespace F4T::SoloCell { inline constexpr auto kVault109EditorId = "COVault109"; inline std::optional& GetVault109CellIdCache() { static std::optional s_vault109CellId; return s_vault109CellId; } inline bool HasEditorId(const RE::TESObjectCELL& a_cell, std::string_view a_editorId) { const auto* cellEditorId = a_cell.GetFormEditorID(); return cellEditorId && a_editorId == cellEditorId; } inline bool IsSoloCell(const RE::TESObjectCELL& a_cell) { if (HasEditorId(a_cell, kVault109EditorId)) { return true; } auto& vault109CellId = GetVault109CellIdCache(); if (!vault109CellId) { const auto* vault109Cell = RE::TESForm::GetFormByEditorID( RE::BSFixedString{ kVault109EditorId }); if (vault109Cell) { vault109CellId = vault109Cell->GetFormID(); } } return vault109CellId && a_cell.GetFormID() == *vault109CellId; } }