diff --git a/NIF_Blocks.cpp b/NIF_Blocks.cpp index 13344c7082cb39e1b2f2e8e97963b9ff1757a63c..0c2978bb388828991db51f3fe7c92b1383fbb267 100644 --- a/NIF_Blocks.cpp +++ b/NIF_Blocks.cpp @@ -555,10 +555,14 @@ void CrossRef::SetCrossRef( IBlock * new_ref ) { } } -void CrossRef::Invalidate() { +void CrossRef::LostRef( IBlock * match ) { //This function's purpouse is to inform this CrossRef that the block it is referencing has died - //Simply set it to NULL - ref = NULL; + //It will be called on every CrossRef in this block, we must check to see if this is the one that + //the message is meant for + if ( ref == match ) { + //Simply set it to NULL do not call KillRef because the reference is already dead + ref = NULL; + } } void CrossRef::Fix( const vector<blk_ref> & blocks ) { diff --git a/NIF_Blocks.h b/NIF_Blocks.h index 54d83ece5e4016aa7d992a6887bddfdfbcaf44d3..d0cb5c3a949b84f8ca95b1a8f46d3688c410b528 100644 --- a/NIF_Blocks.h +++ b/NIF_Blocks.h @@ -162,7 +162,7 @@ public: void SetIndex( const int new_index ); IBlock * GetCrossRef() const { return ref; } void SetCrossRef( IBlock * new_ref ); - void Invalidate(); + void LostRef( IBlock * match ); void Fix( const vector<blk_ref> & blocks ); private: IBlock * _owner;