Fix invisibility not breaking on certain actions

deque
scrawl 11 years ago
parent b0fbea9d57
commit 117b812fb1

@ -233,6 +233,9 @@ namespace MWGui
MWBase::World* world = MWBase::Environment::get().getWorld(); MWBase::World* world = MWBase::Environment::get().getWorld();
MWBase::Environment::get().getWorld()->breakInvisibility(
MWBase::Environment::get().getWorld()->getPlayerPtr());
MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize(); MyGUI::IntSize viewSize = MyGUI::RenderManager::getInstance().getViewSize();
MyGUI::IntPoint cursorPosition = MyGUI::InputManager::getInstance().getMousePosition(); MyGUI::IntPoint cursorPosition = MyGUI::InputManager::getInstance().getMousePosition();
float mouseX = cursorPosition.left / float(viewSize.width); float mouseX = cursorPosition.left / float(viewSize.width);

@ -541,9 +541,11 @@ namespace MWGui
int count = object.getRefData().getCount(); int count = object.getRefData().getCount();
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
MWBase::Environment::get().getWorld()->breakInvisibility(player);
// add to player inventory // add to player inventory
// can't use ActionTake here because we need an MWWorld::Ptr to the newly inserted object // can't use ActionTake here because we need an MWWorld::Ptr to the newly inserted object
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayerPtr();
MWWorld::Ptr newObject = *player.getClass().getContainerStore (player).add (object, object.getRefData().getCount(), player); MWWorld::Ptr newObject = *player.getClass().getContainerStore (player).add (object, object.getRefData().getCount(), player);
// remove from world // remove from world
MWBase::Environment::get().getWorld()->deleteObject (object); MWBase::Environment::get().getWorld()->deleteObject (object);

@ -3,6 +3,9 @@
#include "class.hpp" #include "class.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
namespace MWWorld namespace MWWorld
{ {
ActionApply::ActionApply (const Ptr& target, const std::string& id) ActionApply::ActionApply (const Ptr& target, const std::string& id)
@ -11,6 +14,8 @@ namespace MWWorld
void ActionApply::executeImp (const Ptr& actor) void ActionApply::executeImp (const Ptr& actor)
{ {
MWBase::Environment::get().getWorld()->breakInvisibility(actor);
MWWorld::Class::get (getTarget()).apply (getTarget(), mId, actor); MWWorld::Class::get (getTarget()).apply (getTarget(), mId, actor);
} }
@ -22,6 +27,8 @@ namespace MWWorld
void ActionApplyWithSkill::executeImp (const Ptr& actor) void ActionApplyWithSkill::executeImp (const Ptr& actor)
{ {
MWBase::Environment::get().getWorld()->breakInvisibility(actor);
if (MWWorld::Class::get (getTarget()).apply (getTarget(), mId, actor) && mUsageType!=-1) if (MWWorld::Class::get (getTarget()).apply (getTarget(), mId, actor) && mUsageType!=-1)
MWWorld::Class::get (getTarget()).skillUsageSucceeded (actor, mSkillIndex, mUsageType); MWWorld::Class::get (getTarget()).skillUsageSucceeded (actor, mSkillIndex, mUsageType);
} }

Loading…
Cancel
Save