summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-04-17 14:06:49 +0200
committerSergeanur <s.anureev@yandex.ua>2020-04-17 14:06:49 +0200
commitc8af08330aadf92a1ddf54d966c96193ae7266c1 (patch)
tree64fd6eeb6bc485d37fd41c2defcd3e4f980d6572
parentMerge remote-tracking branches 'origin/master' and 'samler/world' into Standalone (diff)
parentFix CWorld::FindObjectsOfTypeInRangeSectorList bug (diff)
downloadre3-c8af08330aadf92a1ddf54d966c96193ae7266c1.tar
re3-c8af08330aadf92a1ddf54d966c96193ae7266c1.tar.gz
re3-c8af08330aadf92a1ddf54d966c96193ae7266c1.tar.bz2
re3-c8af08330aadf92a1ddf54d966c96193ae7266c1.tar.lz
re3-c8af08330aadf92a1ddf54d966c96193ae7266c1.tar.xz
re3-c8af08330aadf92a1ddf54d966c96193ae7266c1.tar.zst
re3-c8af08330aadf92a1ddf54d966c96193ae7266c1.zip
-rw-r--r--src/core/World.cpp18
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;
+ }
}
}
}