Fix a wrong use of reference that causes potential crash

This commit is contained in:
scrawl 2014-05-15 01:53:52 +02:00
parent 471bbd0021
commit 37b9d2fb0c

View file

@ -11,9 +11,9 @@ namespace MWMechanics
{ {
/// \brief AiPackage to have an actor avoid an opening door /// \brief AiPackage to have an actor avoid an opening door
/** The AI will retreat from the door until it has finished opening, walked far away from it, or one second has passed, in an attempt to avoid it /** The AI will retreat from the door until it has finished opening, walked far away from it, or one second has passed, in an attempt to avoid it
**/ **/
class AiAvoidDoor : public AiPackage class AiAvoidDoor : public AiPackage
{ {
public: public:
/// Avoid door until the door is fully open /// Avoid door until the door is fully open
AiAvoidDoor(const MWWorld::Ptr& doorPtr); AiAvoidDoor(const MWWorld::Ptr& doorPtr);
@ -29,10 +29,10 @@ namespace MWMechanics
private: private:
float mDuration; float mDuration;
const MWWorld::Ptr& mDoorPtr; MWWorld::Ptr mDoorPtr;
ESM::Position mLastPos; ESM::Position mLastPos;
float mAdjAngle; float mAdjAngle;
}; };
} }
#endif #endif