From 16cc1ad59f7cc18f97abb5f5d1cfa98ee531af37 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Sat, 2 Sep 2023 02:44:31 +0300 Subject: [PATCH] Editor: Disable Training service for creatures --- apps/opencs/model/world/refidadapterimp.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/opencs/model/world/refidadapterimp.cpp b/apps/opencs/model/world/refidadapterimp.cpp index 149b5d19ca7..ba9c6d65a76 100644 --- a/apps/opencs/model/world/refidadapterimp.cpp +++ b/apps/opencs/model/world/refidadapterimp.cpp @@ -516,10 +516,18 @@ QVariant CSMWorld::CreatureRefIdAdapter::getData(const RefIdColumn* column, cons if (column == mColumns.mBloodType) return record.get().mBloodType; - std::map::const_iterator iter = mColumns.mFlags.find(column); + { + std::map::const_iterator iter = mColumns.mFlags.find(column); - if (iter != mColumns.mFlags.end()) - return (record.get().mFlags & iter->second) != 0; + if (iter != mColumns.mFlags.end()) + return (record.get().mFlags & iter->second) != 0; + } + + { + std::map::const_iterator iter = mColumns.mServices.find(column); + if (iter != mColumns.mServices.end() && iter->second == ESM::NPC::Training) + return QVariant(); + } return ActorRefIdAdapter::getData(column, data, index); }