mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-20 00:23:51 +00:00
Fix wrong door sounds
This commit is contained in:
parent
9648804af5
commit
867c7db014
4 changed files with 15 additions and 4 deletions
|
@ -326,6 +326,8 @@ namespace MWBase
|
|||
virtual void setupPlayer(bool newGame) = 0;
|
||||
virtual void renderPlayer() = 0;
|
||||
|
||||
virtual bool getOpenOrCloseDoor(const MWWorld::Ptr& door) = 0;
|
||||
///< if activated, should this door be opened or closed?
|
||||
virtual void activateDoor(const MWWorld::Ptr& door) = 0;
|
||||
///< activate (open or close) an non-teleport door
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ namespace MWClass
|
|||
{
|
||||
// animated door
|
||||
boost::shared_ptr<MWWorld::Action> action(new MWWorld::ActionDoor(ptr));
|
||||
if (ptr.getRefData().getLocalRotation().rot[2] == 0)
|
||||
if (MWBase::Environment::get().getWorld()->getOpenOrCloseDoor(ptr))
|
||||
action->setSound(openSound);
|
||||
else
|
||||
action->setSound(closeSound);
|
||||
|
|
|
@ -1548,4 +1548,11 @@ namespace MWWorld
|
|||
mDoorStates[door] = 0; // close
|
||||
}
|
||||
}
|
||||
|
||||
bool World::getOpenOrCloseDoor(const Ptr &door)
|
||||
{
|
||||
if (mDoorStates.find(door) != mDoorStates.end())
|
||||
return !mDoorStates[door]; // if currently opening or closing, then do the opposite
|
||||
return door.getRefData().getLocalRotation().rot[2] == 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,6 +113,9 @@ namespace MWWorld
|
|||
void addContainerScripts(const Ptr& reference, Ptr::CellStore* cell);
|
||||
void PCDropped (const Ptr& item);
|
||||
|
||||
virtual void processDoors(float duration);
|
||||
///< Run physics simulation and modify \a world accordingly.
|
||||
|
||||
public:
|
||||
|
||||
World (OEngine::Render::OgreRenderer& renderer,
|
||||
|
@ -272,9 +275,6 @@ namespace MWWorld
|
|||
virtual void doPhysics(const PtrMovementList &actors, float duration);
|
||||
///< Run physics simulation and modify \a world accordingly.
|
||||
|
||||
virtual void processDoors(float duration);
|
||||
///< Run physics simulation and modify \a world accordingly.
|
||||
|
||||
virtual bool toggleCollisionMode();
|
||||
///< Toggle collision mode for player. If disabled player object should ignore
|
||||
/// collisions and gravity.
|
||||
|
@ -374,6 +374,8 @@ namespace MWWorld
|
|||
virtual void setupPlayer(bool newGame);
|
||||
virtual void renderPlayer();
|
||||
|
||||
virtual bool getOpenOrCloseDoor(const MWWorld::Ptr& door);
|
||||
///< if activated, should this door be opened or closed?
|
||||
virtual void activateDoor(const MWWorld::Ptr& door);
|
||||
///< activate (open or close) an non-teleport door
|
||||
|
||||
|
|
Loading…
Reference in a new issue