diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-07-21 04:59:31 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-07-22 14:19:22 +0200 |
commit | f40f44b14e028c4bb2bee2e898c210e3f41b20bb (patch) | |
tree | f66810ab48dc09fd116db6d7e81822c6f760444f /src/entities | |
parent | fixed COcclusion (diff) | |
download | re3-f40f44b14e028c4bb2bee2e898c210e3f41b20bb.tar re3-f40f44b14e028c4bb2bee2e898c210e3f41b20bb.tar.gz re3-f40f44b14e028c4bb2bee2e898c210e3f41b20bb.tar.bz2 re3-f40f44b14e028c4bb2bee2e898c210e3f41b20bb.tar.lz re3-f40f44b14e028c4bb2bee2e898c210e3f41b20bb.tar.xz re3-f40f44b14e028c4bb2bee2e898c210e3f41b20bb.tar.zst re3-f40f44b14e028c4bb2bee2e898c210e3f41b20bb.zip |
Diffstat (limited to 'src/entities')
-rw-r--r-- | src/entities/Entity.cpp | 17 | ||||
-rw-r--r-- | src/entities/Entity.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/entities/Entity.cpp b/src/entities/Entity.cpp index 63ea03fc..4c88c485 100644 --- a/src/entities/Entity.cpp +++ b/src/entities/Entity.cpp @@ -620,6 +620,23 @@ CEntity::PruneReferences(void) } } +// 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; + } +} + void CEntity::UpdateRpHAnim(void) { diff --git a/src/entities/Entity.h b/src/entities/Entity.h index 7570110b..fd01b6f8 100644 --- a/src/entities/Entity.h +++ b/src/entities/Entity.h @@ -168,6 +168,7 @@ public: void RegisterReference(CEntity **pent); void ResolveReferences(void); void PruneReferences(void); + void CleanUpOldReference(CEntity **pent); #ifdef PED_SKIN void UpdateRpHAnim(void); |