mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-05-09 12:07:51 +03:00
Do not allow player to take items from evidence chests (bug #3609)
This commit is contained in:
parent
271d8e6d74
commit
4a6d2cbaff
3 changed files with 10 additions and 2 deletions
|
@ -275,9 +275,11 @@ namespace MWClass
|
|||
if (ptr.getCellRef().getTrap() != "")
|
||||
text += "\n#{sTrapped}";
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||
text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp())
|
||||
{ text += MWGui::ToolTips::getCellRefString(ptr.getCellRef());
|
||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||
if (Misc::StringUtils::ciEqual(ptr.getCellRef().getRefId(), "stolen_goods"))
|
||||
text += "\nYou can not use evidence chests";
|
||||
}
|
||||
|
||||
info.text = text;
|
||||
|
|
|
@ -950,6 +950,7 @@ namespace MWMechanics
|
|||
return true;
|
||||
|
||||
const MWWorld::CellRef& cellref = target.getCellRef();
|
||||
|
||||
// there is no harm to use unlocked doors
|
||||
int lockLevel = cellref.getLockLevel();
|
||||
if (target.getClass().isDoor() &&
|
||||
|
@ -1005,6 +1006,10 @@ namespace MWMechanics
|
|||
if (!cellref.getOwner().empty())
|
||||
victim = MWBase::Environment::get().getWorld()->searchPtr(cellref.getOwner(), true, false);
|
||||
|
||||
// A special case for evidence chest - we should not allow to take items even if it is technically permitted
|
||||
if (Misc::StringUtils::ciEqual(cellref.getRefId(), "stolen_goods"))
|
||||
return false;
|
||||
|
||||
return (!isOwned && !isFactionOwned);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue