summaryrefslogtreecommitdiffstats
path: root/src/core/References.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/References.cpp')
-rw-r--r--src/core/References.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/core/References.cpp b/src/core/References.cpp
index b7782099..09913817 100644
--- a/src/core/References.cpp
+++ b/src/core/References.cpp
@@ -42,6 +42,23 @@ CEntity::RegisterReference(CEntity **pent)
}
}
+// 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)