bug fixes

This commit is contained in:
Nikolay Korolev
2020-01-01 23:55:01 +03:00
parent c05c516ce7
commit 42ff0f7c58
5 changed files with 13 additions and 7 deletions

View File

@ -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;
}