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); } } }