From a47c76001c085315f43688cb507539ea44bec3f4 Mon Sep 17 00:00:00 2001 From: Emanuel Guevel Date: Tue, 13 Aug 2013 04:44:25 +0200 Subject: [PATCH] Apply trap magic effects --- apps/openmw/mwclass/container.cpp | 3 ++- apps/openmw/mwclass/door.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index d057eea6a..783eabff6 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -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 action(new MWWorld::FailedAction); + boost::shared_ptr action(new MWWorld::ActionApply(actor, ptr.getCellRef().mTrap)); action->setSound(trapActivationSound); ptr.getCellRef().mTrap = ""; return action; diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp index e66b8ca8e..3a0e4d0ba 100644 --- a/apps/openmw/mwclass/door.cpp +++ b/apps/openmw/mwclass/door.cpp @@ -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 action(new MWWorld::FailedAction); + boost::shared_ptr action(new MWWorld::ActionApply(actor, ptr.getCellRef().mTrap)); action->setSound(trapActivationSound); ptr.getCellRef().mTrap = "";