From ea0da8533cbcece6392017d655e9c94e4258cb93 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 25 May 2020 19:20:51 +0200 Subject: [PATCH] - added missing range check to section code. Fixes asserts on some maps in Kama Sutra. --- src/r_data/r_sections.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/r_data/r_sections.h b/src/r_data/r_sections.h index fcd7cd3b2..221d19e63 100644 --- a/src/r_data/r_sections.h +++ b/src/r_data/r_sections.h @@ -141,6 +141,7 @@ public: } TArrayView SectionsForSector(int sindex) { + if (numberOfSectionForSectorPtr[sindex] == 0) return TArrayView(nullptr); return sindex < 0 ? TArrayView(0) : TArrayView(&allSections[firstSectionForSectorPtr[sindex]], numberOfSectionForSectorPtr[sindex]); } int SectionIndex(const FSection *sect)