From bee9eafc1acacc6b0b7444572cb59d58e2018d2b Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Sat, 8 Apr 2023 11:39:38 +0200 Subject: [PATCH] Only autocomplete string refids --- apps/openmw/mwgui/console.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/openmw/mwgui/console.cpp b/apps/openmw/mwgui/console.cpp index 6b7cb31c75..b743fd91ef 100644 --- a/apps/openmw/mwgui/console.cpp +++ b/apps/openmw/mwgui/console.cpp @@ -107,22 +107,27 @@ namespace MWGui scanner.listKeywords(mNames); // identifier - const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); + const MWWorld::ESMStore& esmStore = MWBase::Environment::get().getWorld()->getStore(); std::vector ids; - for (MWWorld::ESMStore::iterator it = store.begin(); it != store.end(); ++it) + for (const auto* store : esmStore) { - (*it)->listIdentifier(ids); + store->listIdentifier(ids); for (auto id : ids) { - mNames.push_back(id.getRefIdString()); + visit( + [&](auto&& variant) { + using T = std::decay_t; + if constexpr (std::is_same_v) + mNames.push_back(id.getRefIdString()); + }, + id); } ids.clear(); } // exterior cell names aren't technically identifiers, but since the COC function accepts them, // we should list them too - for (MWWorld::Store::iterator it = store.get().extBegin(); - it != store.get().extEnd(); ++it) + for (auto it = esmStore.get().extBegin(); it != esmStore.get().extEnd(); ++it) { if (!it->mName.empty()) mNames.push_back(it->mName);