diff options
author | saml1er <danishroar@gmail.com> | 2020-04-17 14:04:09 +0200 |
---|---|---|
committer | saml1er <danishroar@gmail.com> | 2020-04-17 14:04:09 +0200 |
commit | ac61da3febc557c16e54bbe8cc946b023e434dc5 (patch) | |
tree | 3a67b6df99786a4ef033f34a7e7ee03f8c2a46ac /src/core/World.cpp | |
parent | Apply clang format to CWorld (diff) | |
download | re3-ac61da3febc557c16e54bbe8cc946b023e434dc5.tar re3-ac61da3febc557c16e54bbe8cc946b023e434dc5.tar.gz re3-ac61da3febc557c16e54bbe8cc946b023e434dc5.tar.bz2 re3-ac61da3febc557c16e54bbe8cc946b023e434dc5.tar.lz re3-ac61da3febc557c16e54bbe8cc946b023e434dc5.tar.xz re3-ac61da3febc557c16e54bbe8cc946b023e434dc5.tar.zst re3-ac61da3febc557c16e54bbe8cc946b023e434dc5.zip |
Diffstat (limited to 'src/core/World.cpp')
-rw-r--r-- | src/core/World.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/core/World.cpp b/src/core/World.cpp index 358e1823..c9e3c11f 100644 --- a/src/core/World.cpp +++ b/src/core/World.cpp @@ -753,14 +753,16 @@ CWorld::FindObjectsOfTypeInRangeSectorList(uint32 modelId, CPtrList &list, const CEntity *pEntity = (CEntity *)pNode->item; if(pEntity->m_scanCode != GetCurrentScanCode()) { pEntity->m_scanCode = GetCurrentScanCode(); - float fMagnitude = 0.0f; - if(bCheck2DOnly) - fMagnitude = (position - pEntity->GetPosition()).MagnitudeSqr2D(); - else - fMagnitude = (position - pEntity->GetPosition()).MagnitudeSqr(); - if(fMagnitude < radius * radius && *nEntitiesFound < maxEntitiesToFind) { - if(aEntities) aEntities[*nEntitiesFound] = pEntity; - ++*nEntitiesFound; + if(modelId == pEntity->m_modelIndex) { + float fMagnitude = 0.0f; + if(bCheck2DOnly) + fMagnitude = (position - pEntity->GetPosition()).MagnitudeSqr2D(); + else + fMagnitude = (position - pEntity->GetPosition()).MagnitudeSqr(); + if(fMagnitude < radius * radius && *nEntitiesFound < maxEntitiesToFind) { + if(aEntities) aEntities[*nEntitiesFound] = pEntity; + ++*nEntitiesFound; + } } } } |