Skip to content

Commit

Permalink
- added missing range check to section code.
Browse files Browse the repository at this point in the history
Fixes asserts on some maps in Kama Sutra.
  • Loading branch information
coelckers committed May 25, 2020
1 parent 6444a75 commit ea0da85
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/r_data/r_sections.h
Expand Up @@ -141,6 +141,7 @@ class FSectionContainer
}
TArrayView<FSection> SectionsForSector(int sindex)
{
if (numberOfSectionForSectorPtr[sindex] == 0) return TArrayView<FSection>(nullptr);
return sindex < 0 ? TArrayView<FSection>(0) : TArrayView<FSection>(&allSections[firstSectionForSectorPtr[sindex]], numberOfSectionForSectorPtr[sindex]);
}
int SectionIndex(const FSection *sect)
Expand Down

0 comments on commit ea0da85

Please sign in to comment.