Apply trap magic effects

This commit is contained in:
Emanuel Guevel 2013-08-13 04:44:25 +02:00
parent 1ad02d68a7
commit a47c76001c
2 changed files with 4 additions and 2 deletions

View file

@ -13,6 +13,7 @@
#include "../mwworld/containerstore.hpp"
#include "../mwworld/customdata.hpp"
#include "../mwworld/cellstore.hpp"
#include "../mwworld/actionapply.hpp"
#include "../mwworld/actionopen.hpp"
#include "../mwworld/physicssystem.hpp"
#include "../mwworld/player.hpp"
@ -148,7 +149,7 @@ namespace MWClass
{
// Trap activation goes here
std::cout << "Activated trap: " << ptr.getCellRef().mTrap << std::endl;
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionApply(actor, ptr.getCellRef().mTrap));
action->setSound(trapActivationSound);
ptr.getCellRef().mTrap = "";
return action;

View file

@ -12,6 +12,7 @@
#include "../mwworld/ptr.hpp"
#include "../mwworld/nullaction.hpp"
#include "../mwworld/failedaction.hpp"
#include "../mwworld/actionapply.hpp"
#include "../mwworld/actionteleport.hpp"
#include "../mwworld/actiondoor.hpp"
#include "../mwworld/cellstore.hpp"
@ -110,7 +111,7 @@ namespace MWClass
// Trap activation
std::cout << "Activated trap: " << ptr.getCellRef().mTrap << std::endl;
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction);
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionApply(actor, ptr.getCellRef().mTrap));
action->setSound(trapActivationSound);
ptr.getCellRef().mTrap = "";