From bd8bb11e851e9ee4d8a646a4d7835929c0573401 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Mon, 12 May 2008 19:44:04 +0000 Subject: [PATCH] move empty course check into Course::GetTrailSorted --- stepmania/src/Course.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stepmania/src/Course.cpp b/stepmania/src/Course.cpp index 3f3f014d41..733c0315a2 100644 --- a/stepmania/src/Course.cpp +++ b/stepmania/src/Course.cpp @@ -349,7 +349,7 @@ Trail* Course::GetTrailForceRegenCache( StepsType st, CourseDifficulty cd ) cons CacheData &cache = m_TrailCache[ CacheEntry(st, cd) ]; Trail &trail = cache.trail; trail.Init(); - if( !GetTrailSorted( st, cd, trail ) || trail.m_vEntries.empty() ) + if( !GetTrailSorted(st, cd, trail) ) { /* This course difficulty doesn't exist. */ cache.null = true; @@ -408,6 +408,8 @@ bool Course::GetTrailSorted( StepsType st, CourseDifficulty cd, Trail &trail ) c trail.m_vEntries[i] = entries[i].entry; } + if( trail.m_vEntries.empty() ) + return false; return true; }