1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00

Fix incorrect trigger of change flag for static doors

This commit is contained in:
scrawl 2014-06-14 19:12:49 +02:00
parent 395f98e476
commit 31a4e10c6f

View File

@ -57,13 +57,15 @@ namespace MWClass
physics.addObject(ptr); physics.addObject(ptr);
// Resume the door's opening/closing animation if it wasn't finished // Resume the door's opening/closing animation if it wasn't finished
ensureCustomData(ptr); if (ptr.getRefData().getCustomData())
{
const DoorCustomData& customData = dynamic_cast<const DoorCustomData&>(*ptr.getRefData().getCustomData()); const DoorCustomData& customData = dynamic_cast<const DoorCustomData&>(*ptr.getRefData().getCustomData());
if (customData.mDoorState > 0) if (customData.mDoorState > 0)
{ {
MWBase::Environment::get().getWorld()->activateDoor(ptr, customData.mDoorState == 1 ? true : false); MWBase::Environment::get().getWorld()->activateDoor(ptr, customData.mDoorState == 1 ? true : false);
} }
} }
}
std::string Door::getModel(const MWWorld::Ptr &ptr) const std::string Door::getModel(const MWWorld::Ptr &ptr) const
{ {