diff options
Diffstat (limited to 'src/core/References.cpp')
-rw-r--r-- | src/core/References.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/References.cpp b/src/core/References.cpp index 6b0c868c..dc83d96d 100644 --- a/src/core/References.cpp +++ b/src/core/References.cpp @@ -44,6 +44,23 @@ CEntity::RegisterReference(CEntity **pent) return; } +// Clean up the reference from *pent -> 'this' +void +CEntity::CleanUpOldReference(CEntity **pent) +{ + CReference* ref, ** lastnextp; + lastnextp = &m_pFirstReference; + for (ref = m_pFirstReference; ref; ref = ref->next) { + if (ref->pentity == pent) { + *lastnextp = ref->next; + ref->next = CReferences::pEmptyList; + CReferences::pEmptyList = ref; + break; + } + lastnextp = &ref->next; + } +} + // Clear all references to this entity void CEntity::ResolveReferences(void) |