diff --git a/apps/openmw/mwclass/container.cpp b/apps/openmw/mwclass/container.cpp index ae1d085ef..c58606996 100644 --- a/apps/openmw/mwclass/container.cpp +++ b/apps/openmw/mwclass/container.cpp @@ -99,8 +99,9 @@ namespace MWClass else { // Trap activation goes here - std::cout << "Trapped with: " << ptr.getCellRef().trap << std::endl; + std::cout << "Activated trap: " << ptr.getCellRef().trap << std::endl; environment.mSoundManager->playSound(trapActivationSound, 1.0, 1.0); + ptr.getCellRef().trap = ""; return boost::shared_ptr (new MWWorld::NullAction); } } diff --git a/apps/openmw/mwclass/door.cpp b/apps/openmw/mwclass/door.cpp index 3c09b36b9..bd7af9597 100644 --- a/apps/openmw/mwclass/door.cpp +++ b/apps/openmw/mwclass/door.cpp @@ -66,6 +66,7 @@ namespace MWClass const std::string &openSound = ref->base->openSound; //const std::string &closeSound = ref->base->closeSound; const std::string lockedSound = "LockedDoor"; + const std::string trapActivationSound = "Disarm Trap Fail"; if (ptr.getCellRef().lockLevel>0) { @@ -76,7 +77,14 @@ namespace MWClass return boost::shared_ptr (new MWWorld::NullAction); } - // TODO check trap + if(!ptr.getCellRef().trap.empty()) + { + // Trap activation + std::cout << "Activated trap: " << ptr.getCellRef().trap << std::endl; + environment.mSoundManager->playSound(trapActivationSound, 1.0, 1.0); + ptr.getCellRef().trap = ""; + return boost::shared_ptr (new MWWorld::NullAction); + } if (ref->ref.teleport) { @@ -99,6 +107,9 @@ namespace MWClass { // animated door // TODO return action for rotating the door + + // This is a little pointless, but helps with testing + environment.mSoundManager->playSound(openSound, 1.0, 1.0); return boost::shared_ptr (new MWWorld::NullAction); } }