1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 11:23:52 +00:00

Fix for not being able to pick up scrolls during combat

This is the behaviour I observed in vanilla morrowind.
This commit is contained in:
scrawl 2014-04-27 09:12:49 +02:00
parent 14757a856b
commit 3161647809

View file

@ -3,7 +3,6 @@
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp" #include "../mwbase/windowmanager.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/player.hpp" #include "../mwworld/player.hpp"
@ -24,7 +23,12 @@ namespace MWWorld
void ActionRead::executeImp (const MWWorld::Ptr& actor) { void ActionRead::executeImp (const MWWorld::Ptr& actor) {
if(MWBase::Environment::get().getWorld()->getPlayer().isInCombat()) { //Ensure we're not in combat //Ensure we're not in combat
if(MWBase::Environment::get().getWorld()->getPlayer().isInCombat()
// Reading in combat is still allowed if the scroll/book is not in the player inventory yet
// (since otherwise, there would be no way to pick it up)
&& getTarget().getContainerStore() == &actor.getClass().getContainerStore(actor)
) {
MWBase::Environment::get().getWindowManager()->messageBox("#{sInventoryMessage4}"); MWBase::Environment::get().getWindowManager()->messageBox("#{sInventoryMessage4}");
return; return;
} }