summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-01-01 21:55:01 +0100
committerNikolay Korolev <nickvnuk@gmail.com>2020-01-01 21:55:01 +0100
commit42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96 (patch)
tree3a9d0420a04b640e4fa4083302cc56fc09d69011 /src/core
parentMerge remote-tracking branch 'upstream/master' into script_dev (diff)
downloadre3-42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96.tar
re3-42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96.tar.gz
re3-42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96.tar.bz2
re3-42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96.tar.lz
re3-42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96.tar.xz
re3-42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96.tar.zst
re3-42ff0f7c586b6700dea7729e9f4e1fa5bd42fc96.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/ZoneCull.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/ZoneCull.cpp b/src/core/ZoneCull.cpp
index 6d33a1cf..6b04c213 100644
--- a/src/core/ZoneCull.cpp
+++ b/src/core/ZoneCull.cpp
@@ -134,14 +134,16 @@ CCullZones::FindAttributesForCoors(CVector coors, int32 *wantedLevel)
int i;
int32 attribs;
+ if (wantedLevel)
+ *wantedLevel = 0;
attribs = 0;
for(i = 0; i < NumAttributeZones; i++)
if(coors.x >= aAttributeZones[i].minx && coors.x <= aAttributeZones[i].maxx &&
coors.y >= aAttributeZones[i].miny && coors.y <= aAttributeZones[i].maxy &&
coors.z >= aAttributeZones[i].minz && coors.z <= aAttributeZones[i].maxz){
attribs |= aAttributeZones[i].attributes;
- if(wantedLevel && *wantedLevel <= aAttributeZones[i].wantedLevel)
- *wantedLevel = aAttributeZones[i].wantedLevel;
+ if(wantedLevel)
+ *wantedLevel = max(*wantedLevel, aAttributeZones[i].wantedLevel);
}
return attribs;
}