From d9dd02c610b3423359adce4287bfc420a7d8dffa Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 20 May 2013 12:42:11 +0200 Subject: [PATCH] Security fixes --- apps/openmw/mwmechanics/security.cpp | 1 + apps/openmw/mwworld/player.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/security.cpp b/apps/openmw/mwmechanics/security.cpp index 090e8ced3c..d19da6e2af 100644 --- a/apps/openmw/mwmechanics/security.cpp +++ b/apps/openmw/mwmechanics/security.cpp @@ -14,6 +14,7 @@ namespace MWMechanics { Security::Security(const MWWorld::Ptr &actor) + : mActor(actor) { CreatureStats& creatureStats = MWWorld::Class::get(actor).getCreatureStats(actor); NpcStats& npcStats = MWWorld::Class::get(actor).getNpcStats(actor); diff --git a/apps/openmw/mwworld/player.cpp b/apps/openmw/mwworld/player.cpp index ebc9cd86d6..e352b4c827 100644 --- a/apps/openmw/mwworld/player.cpp +++ b/apps/openmw/mwworld/player.cpp @@ -179,7 +179,9 @@ namespace MWWorld // tool used up? if (!item.getRefData().getCount()) - MWBase::Environment::get().getWindowManager()->setSelectedWeapon(MWWorld::Ptr()); + MWBase::Environment::get().getWindowManager()->unsetSelectedWeapon(); + else + MWBase::Environment::get().getWindowManager()->setSelectedWeapon(item); } } }