From 61c4fa0630225201c4f1649f96e6086cb0afe4b1 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Mon, 30 Aug 2010 12:02:47 +0200 Subject: [PATCH] blocked using of locked doors (keys are not considered yet) --- apps/openmw/mwclass/door.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp index d15a01e9f..c22b8005e 100644 --- a/apps/openmw/mwclass/door.cpp +++ b/apps/openmw/mwclass/door.cpp @@ -15,6 +15,8 @@ #include "../mwrender/cellimp.hpp" +#include + namespace MWClass { void Door::insertObj (const MWWorld::Ptr& ptr, MWRender::CellRenderImp& cellRender, @@ -50,7 +52,14 @@ namespace MWClass ESMS::LiveCellRef *ref = ptr.get(); - // TODO check lock + if (ptr.getCellRef().lockLevel>0) + { + // TODO check for key + // TODO report failure to player (message, sound?). Look up behaviour of original MW. + std::cout << "Locked!" << std::endl; + return boost::shared_ptr (new MWWorld::NullAction); + } + // TODO check trap if (ref->ref.teleport)