mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-06 00:55:50 +00:00
Allow creatures to be companions again
This commit is contained in:
parent
690a237896
commit
7c5caec443
@ -71,7 +71,7 @@ namespace MWGui
|
||||
|
||||
const ItemStack& item = mSortModel->getItem(index);
|
||||
|
||||
// We can't take conjured items from a companion NPC
|
||||
// We can't take conjured items from a companion actor
|
||||
if (item.mFlags & ItemStack::Flag_Bound)
|
||||
{
|
||||
MWBase::Environment::get().getWindowManager()->messageBox("#{sBarterDialog12}");
|
||||
@ -119,13 +119,13 @@ namespace MWGui
|
||||
}
|
||||
}
|
||||
|
||||
void CompanionWindow::setPtr(const MWWorld::Ptr& npc)
|
||||
void CompanionWindow::setPtr(const MWWorld::Ptr& actor)
|
||||
{
|
||||
if (npc.isEmpty() || npc.getType() != ESM::REC_NPC_)
|
||||
if (actor.isEmpty() || !actor.getClass().isActor())
|
||||
throw std::runtime_error("Invalid argument in CompanionWindow::setPtr");
|
||||
mPtr = npc;
|
||||
mPtr = actor;
|
||||
updateEncumbranceBar();
|
||||
auto model = std::make_unique<CompanionItemModel>(npc);
|
||||
auto model = std::make_unique<CompanionItemModel>(actor);
|
||||
mModel = model.get();
|
||||
auto sortModel = std::make_unique<SortFilterItemModel>(std::move(model));
|
||||
mSortModel = sortModel.get();
|
||||
@ -133,7 +133,7 @@ namespace MWGui
|
||||
mItemView->setModel(std::move(sortModel));
|
||||
mItemView->resetScrollBars();
|
||||
|
||||
setTitle(npc.getClass().getName(npc));
|
||||
setTitle(actor.getClass().getName(actor));
|
||||
}
|
||||
|
||||
void CompanionWindow::onFrame(float dt)
|
||||
|
@ -26,7 +26,7 @@ namespace MWGui
|
||||
|
||||
void resetReference() override;
|
||||
|
||||
void setPtr(const MWWorld::Ptr& npc) override;
|
||||
void setPtr(const MWWorld::Ptr& actor) override;
|
||||
void onFrame(float dt) override;
|
||||
void clear() override { resetReference(); }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user