1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-31 12:36:42 +00:00

Use localized faction name when using TFH

This commit is contained in:
Andrei Kortunov 2019-10-05 16:59:04 +04:00
parent f0b73e0a27
commit f75f9cb337

View file

@ -652,12 +652,14 @@ namespace MWGui
std::string ret; std::string ret;
ret += getMiscString(cellref.getOwner(), "Owner"); ret += getMiscString(cellref.getOwner(), "Owner");
const std::string factionId = cellref.getFaction(); const std::string factionId = cellref.getFaction();
ret += getMiscString(factionId, "Faction"); if (!factionId.empty())
if (!factionId.empty() && cellref.getFactionRank() >= 0)
{ {
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore(); const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
const ESM::Faction *fact = store.get<ESM::Faction>().search(factionId); const ESM::Faction *fact = store.get<ESM::Faction>().search(factionId);
if (fact != nullptr) if (fact != nullptr)
{
ret += getMiscString(fact->mName.empty() ? factionId : fact->mName, "Owner Faction");
if (cellref.getFactionRank() >= 0)
{ {
int rank = cellref.getFactionRank(); int rank = cellref.getFactionRank();
const std::string rankName = fact->mRanks[rank]; const std::string rankName = fact->mRanks[rank];
@ -667,6 +669,7 @@ namespace MWGui
ret += getMiscString(rankName, "Rank"); ret += getMiscString(rankName, "Rank");
} }
} }
}
std::vector<std::pair<std::string, int> > itemOwners = std::vector<std::pair<std::string, int> > itemOwners =
MWBase::Environment::get().getMechanicsManager()->getStolenItemOwners(cellref.getRefId()); MWBase::Environment::get().getMechanicsManager()->getStolenItemOwners(cellref.getRefId());