diff options
Diffstat (limited to '')
-rw-r--r-- | src/levelinfo.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/levelinfo.cpp b/src/levelinfo.cpp index 8ce2845..d5ef8e7 100644 --- a/src/levelinfo.cpp +++ b/src/levelinfo.cpp @@ -7,10 +7,9 @@ void dLevelInfo_c::load(void *buffer) { for (int sect = 0; sect < sectionCount(); sect++) {
// parse this section
section_s *thisSect = getSectionByIndex(sect);
- entry_s *levels = getLevelsForSection(thisSect);
for (int lev = 0; lev < thisSect->levelCount; lev++) {
- entry_s *level = &levels[lev];
+ entry_s *level = &thisSect->levels[lev];
SetSomeConditionShit(level->worldSlot, level->levelSlot, level->flags);
@@ -28,7 +27,7 @@ dLevelInfo_c::entry_s *dLevelInfo_c::searchBySlot(int world, int level) { section_s *sect = getSectionByIndex(i);
for (int j = 0; j < sect->levelCount; j++) {
- entry_s *entry = &getLevelsForSection(sect)[j];
+ entry_s *entry = §->levels[j];
if (entry->worldSlot == world && entry->levelSlot == level)
return entry;
}
@@ -37,3 +36,17 @@ dLevelInfo_c::entry_s *dLevelInfo_c::searchBySlot(int world, int level) { return 0;
}
+dLevelInfo_c::entry_s *dLevelInfo_c::searchByDisplayNum(int world, int level) {
+ for (int i = 0; i < sectionCount(); i++) {
+ section_s *sect = getSectionByIndex(i);
+
+ for (int j = 0; j < sect->levelCount; j++) {
+ entry_s *entry = §->levels[j];
+ if (entry->displayWorld == world && entry->displayLevel == level)
+ return entry;
+ }
+ }
+
+ return 0;
+}
+
|